Skip to content

Commit 816cce2

Browse files
GitHub OAuth authentication for RHDH
1 parent 9f8857c commit 816cce2

4 files changed

Lines changed: 12 additions & 29 deletions

File tree

config/app-config-rhdh.yaml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ auth:
1111
session:
1212
secret: superSecretSecret
1313
providers:
14-
oidc:
14+
github:
1515
production:
16-
metadataUrl: "${KEYCLOAK_METADATA_URL}"
17-
clientId: "${KEYCLOAK_CLIENT_ID}"
18-
clientSecret: "${KEYCLOAK_CLIENT_SECRET}"
19-
prompt: auto
20-
callbackUrl: "${RHDH_BASE_URL}/api/auth/oidc/handler/frame"
16+
clientSecret: ${GITHUB_OAUTH_APP_SECRET}
17+
clientId: ${GITHUB_OAUTH_APP_ID}
18+
callbackUrl: ${RHDH_BASE_URL}/api/auth/github/handler/frame
2119
signIn:
2220
resolvers:
23-
- resolver: emailLocalPartMatchingUserEntityName
24-
signInPage: oidc
21+
- resolver: usernameMatchingUserEntityName
22+
dangerouslyAllowSignInWithoutUserInCatalog: true
23+
signInPage: github
2524
catalog:
2625
import:
2726
entityFilename: catalog-info.yaml
@@ -34,15 +33,3 @@ catalog:
3433
target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml
3534
- type: url
3635
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml
37-
providers:
38-
keycloakOrg:
39-
default:
40-
baseUrl: "${KEYCLOAK_BASE_URL}"
41-
loginRealm: "${KEYCLOAK_LOGIN_REALM}"
42-
realm: "${KEYCLOAK_REALM}"
43-
clientId: "${KEYCLOAK_CLIENT_ID}"
44-
clientSecret: "${KEYCLOAK_CLIENT_SECRET}"
45-
schedule:
46-
frequency: { minutes: 3 }
47-
initialDelay: { seconds: 15 }
48-
timeout: { minutes: 5 }

config/dynamic-plugins.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
includes:
22
- dynamic-plugins.default.yaml
33
plugins:
4-
- package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-keycloak-dynamic
5-
disabled: false
4+
# - package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-keycloak-dynamic
5+
# disabled: false
66

config/rhdh-secrets.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,5 @@ metadata:
55
type: Opaque
66
stringData:
77
RHDH_BASE_URL: $RHDH_BASE_URL
8-
KEYCLOAK_BASE_URL: $KEYCLOAK_BASE_URL
9-
KEYCLOAK_METADATA_URL: $KEYCLOAK_METADATA_URL
10-
KEYCLOAK_LOGIN_REALM: $KEYCLOAK_LOGIN_REALM
11-
KEYCLOAK_REALM: $KEYCLOAK_REALM
12-
KEYCLOAK_CLIENT_ID: $KEYCLOAK_CLIENT_ID
13-
KEYCLOAK_CLIENT_SECRET: $KEYCLOAK_CLIENT_SECRET
8+
GITHUB_OAUTH_APP_SECRET: $GITHUB_OAUTH_APP_SECRET
9+
GITHUB_OAUTH_APP_ID: $GITHUB_OAUTH_APP_ID

deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fi
3131

3232
# Deploy Keycloak with users and roles.
3333
# comment this out if you don't want to deploy Keycloak or use your own Keycloak instance.
34-
source utils/keycloak/keycloak-deploy.sh $namespace
34+
# source utils/keycloak/keycloak-deploy.sh $namespace
3535

3636
[[ "${OPENSHIFT_CI}" != "true" ]] && source .env
3737
# source utils/utils.sh

0 commit comments

Comments
 (0)