Authentication Red Hat Developer Hub 1.4 Configuring authentication to external services in Red Hat Developer Hub Red Hat Customer Content Services

Commands:
auth: environment: development providers: guest: dangerouslyAllowOutsideDevelopment: true
upstream: backstage: appConfig: app: baseUrl: 'https://{{- include "janus-idp.hostname" . }}' auth: environment: development providers: guest: dangerouslyAllowOutsideDevelopment: true
auth: environment: production providers: oidc: production: metadataUrl: USD{AUTH_OIDC_METADATA_URL} clientId: USD{AUTH_OIDC_CLIENT_ID} clientSecret: USD{AUTH_OIDC_CLIENT_SECRET} prompt: auto signInPage: oidc
auth: environment: production providers: oidc: production: metadataUrl: USD{AUTH_OIDC_METADATA_URL} clientId: USD{AUTH_OIDC_CLIENT_ID} clientSecret: USD{AUTH_OIDC_CLIENT_SECRET} prompt: auto signInPage: oidc dangerouslyAllowSignInWithoutUserInCatalog: true
auth: providers: oidc: production: callbackUrl: USD{AUTH_OIDC_CALLBACK_URL}
auth: providers: oidc: production: tokenEndpointAuthMethod: USD{AUTH_OIDC_TOKEN_ENDPOINT_METHOD}
auth: providers: oidc: production: tokenSignedResponseAlg: USD{AUTH_OIDC_SIGNED_RESPONSE_ALG}
auth: providers: oidc: production: scope: USD{AUTH_OIDC_SCOPE}
auth: providers: oidc: production: signIn: resolvers: - resolver: preferredUsernameMatchingUserEntityName - resolver: emailMatchingUserEntityProfileEmail - resolver: emailLocalPartMatchingUserEntityName
auth: backstageTokenExpiration: { minutes: <user_defined_value> }
dangerouslyAllowSignInWithoutUserInCatalog: false catalog: providers: keycloakOrg: default: baseUrl: USD{AUTH_OIDC_METADATA_URL} clientId: USD{AUTH_OIDC_CLIENT_ID} clientSecret: USD{AUTH_OIDC_CLIENT_SECRET}
catalog: providers: keycloakOrg: default: realm: master
catalog: providers: keycloakOrg: default: loginRealm: master
catalog: providers: keycloakOrg: default: userQuerySize: 100
catalog: providers: keycloakOrg: default: groupQuerySize: 100
catalog: providers: keycloakOrg: default: schedule: frequency: { hours: 1 }
catalog: providers: keycloakOrg: default: schedule: timeout: { minutes: 50 }
catalog: providers: keycloakOrg: default: schedule: initialDelay: { seconds: 15}
{"class":"KeycloakOrgEntityProvider","level":"info","message":"Read 3 Keycloak users and 2 Keycloak groups in 1.5 seconds. Committing...","plugin":"catalog","service":"backstage","taskId":"KeycloakOrgEntityProvider:default:refresh","taskInstanceId":"bf0467ff-8ac4-4702-911c-380270e44dea","timestamp":"2024-09-25 13:58:04"} {"class":"KeycloakOrgEntityProvider","level":"info","message":"Committed 3 Keycloak users and 2 Keycloak groups in 0.0 seconds.","plugin":"catalog","service":"backstage","taskId":"KeycloakOrgEntityProvider:default:refresh","taskInstanceId":"bf0467ff-8ac4-4702-911c-380270e44dea","timestamp":"2024-09-25 13:58:04"}
import { GroupTransformer, keycloakTransformerExtensionPoint, UserTransformer, } from '@backstage-community/plugin-catalog-backend-module-keycloak'; const customGroupTransformer: GroupTransformer = async ( entity, // entity output from default parser realm, // Keycloak realm name groups, // Keycloak group representation ) => { /* apply transformations */ return entity; }; const customUserTransformer: UserTransformer = async ( entity, // entity output from default parser user, // Keycloak user representation realm, // Keycloak realm name groups, // Keycloak group representation ) => { /* apply transformations */ return entity; }; export const keycloakBackendModuleTransformer = createBackendModule({ pluginId: 'catalog', moduleId: 'keycloak-transformer', register(reg) { reg.registerInit({ deps: { keycloak: keycloakTransformerExtensionPoint, }, async init({ keycloak }) { keycloak.setUserTransformer(customUserTransformer); keycloak.setGroupTransformer(customGroupTransformer); /* highlight-add-end */ }, }); }, });
backend.add(import(backstage-plugin-catalog-backend-module-keycloak-transformer))
{"class":"KeycloakOrgEntityProvider","level":"info","message":"Read 3 Keycloak users and 2 Keycloak groups in 1.5 seconds. Committing...","plugin":"catalog","service":"backstage","taskId":"KeycloakOrgEntityProvider:default:refresh","taskInstanceId":"bf0467ff-8ac4-4702-911c-380270e44dea","timestamp":"2024-09-25 13:58:04"} {"class":"KeycloakOrgEntityProvider","level":"info","message":"Committed 3 Keycloak users and 2 Keycloak groups in 0.0 seconds.","plugin":"catalog","service":"backstage","taskId":"KeycloakOrgEntityProvider:default:refresh","taskInstanceId":"bf0467ff-8ac4-4702-911c-380270e44dea","timestamp":"2024-09-25 13:58:04"}
auth: environment: production providers: github: production: clientId: USD{AUTH_GITHUB_CLIENT_ID} clientSecret: USD{AUTH_GITHUB_CLIENT_SECRET} integrations: github: - host: USD{GITHUB_HOST_DOMAIN} apps: - appId: USD{AUTH_GITHUB_APP_ID} clientId: USD{AUTH_GITHUB_CLIENT_ID} clientSecret: USD{GITHUB_CLIENT_SECRET} webhookUrl: USD{GITHUB_WEBHOOK_URL} webhookSecret: USD{GITHUB_WEBHOOK_SECRET} privateKey: | USD{GITHUB_PRIVATE_KEY_FILE} signInPage: github
auth: environment: production providers: github: production: clientId: USD{AUTH_GITHUB_CLIENT_ID} clientSecret: USD{AUTH_GITHUB_CLIENT_SECRET} integrations: github: - host: USD{GITHUB_HOST_DOMAIN} apps: - appId: USD{AUTH_GITHUB_APP_ID} clientId: USD{AUTH_GITHUB_CLIENT_ID} clientSecret: USD{GITHUB_CLIENT_SECRET} webhookUrl: USD{GITHUB_WEBHOOK_URL} webhookSecret: USD{GITHUB_WEBHOOK_SECRET} privateKey: | USD{GITHUB_PRIVATE_KEY_FILE} signInPage: github dangerouslyAllowSignInWithoutUserInCatalog: true
auth: providers: github: production: callbackUrl: <your_intermediate_service_url/handler>
auth: environment: production providers: github: production: clientId: USD{AUTH_GITHUB_CLIENT_ID} clientSecret: USD{AUTH_GITHUB_CLIENT_SECRET} <your_other_authentication_providers_configuration> integrations: github: - host: USD{GITHUB_HOST_DOMAIN} apps: - appId: USD{AUTH_GITHUB_APP_ID} clientId: USD{AUTH_GITHUB_CLIENT_ID} clientSecret: USD{GITHUB_CLIENT_SECRET} webhookUrl: USD{GITHUB_WEBHOOK_URL} webhookSecret: USD{GITHUB_WEBHOOK_SECRET} privateKey: | USD{GITHUB_PRIVATE_KEY_FILE} signInPage: <your_main_authentication_provider>
dangerouslyAllowSignInWithoutUserInCatalog: false catalog: providers: github: providerId: organization: "USD{GITHUB_ORGANIZATION}" schedule: frequency: minutes: 30 initialDelay: seconds: 15 timeout: minutes: 15 githubOrg: githubUrl: "USD{GITHUB_HOST_DOMAIN}" orgs: [ "USD{GITHUB_ORGANIZATION}" ] schedule: frequency: minutes: 30 initialDelay: seconds: 15 timeout: minutes: 15
{"class":"GithubMultiOrgEntityProvider","level":"info","message":"Reading GitHub users and teams for org: rhdh-dast","plugin":"catalog","service":"backstage","target":"https://github.com","taskId":"GithubMultiOrgEntityProvider:production:refresh","taskInstanceId":"801b3c6c-167f-473b-b43e-e0b4b780c384","timestamp":"2024-09-09 23:55:58"} {"class":"GithubMultiOrgEntityProvider","level":"info","message":"Read 7 GitHub users and 2 GitHub groups in 0.4 seconds. Committing...","plugin":"catalog","service":"backstage","target":"https://github.com","taskId":"GithubMultiOrgEntityProvider:production:refresh","taskInstanceId":"801b3c6c-167f-473b-b43e-e0b4b780c384","timestamp":"2024-09-09 23:55:59"}
auth: environment: production providers: microsoft: production: clientId: USD{AUTH_AZURE_CLIENT_ID} clientSecret: USD{AUTH_AZURE_CLIENT_SECRET} tenantId: USD{AUTH_AZURE_TENANT_ID} signInPage: microsoft
auth: environment: production providers: microsoft: production: clientId: USD{AUTH_AZURE_CLIENT_ID} clientSecret: USD{AUTH_AZURE_CLIENT_SECRET} tenantId: USD{AUTH_AZURE_TENANT_ID} signInPage: microsoft dangerouslyAllowSignInWithoutUserInCatalog: true
auth: environment: production providers: microsoft: production: domainHint: USD{AUTH_AZURE_TENANT_ID}
auth: environment: production providers: microsoft: production: additionalScopes: - Mail.Send
dangerouslyAllowSignInWithoutUserInCatalog: false catalog: providers: microsoftGraphOrg: providerId: target: https://graph.microsoft.com/v1.0 tenantId: USD{AUTH_AZURE_TENANT_ID} clientId: USD{AUTH_AZURE_CLIENT_ID} clientSecret: USD{AUTH_AZURE_CLIENT_SECRET}
catalog: providers: microsoftGraphOrg: providerId: authority: https://login.microsoftonline.com/
catalog: providers: microsoftGraphOrg: providerId: queryMode: advanced
catalog: providers: microsoftGraphOrg: providerId: user: expand: manager
catalog: providers: microsoftGraphOrg: providerId: user: filter: accountEnabled eq true and userType eq 'member'
catalog: providers: microsoftGraphOrg: providerId: user: loadPhotos: true
catalog: providers: microsoftGraphOrg: providerId: user: select: ['id', 'displayName', 'description']
catalog: providers: microsoftGraphOrg: providerId: userGroupMember: filter: "displayName eq 'Backstage Users'"
catalog: providers: microsoftGraphOrg: providerId: userGroupMember: search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")'
catalog: providers: microsoftGraphOrg: providerId: group: expand: member
catalog: providers: microsoftGraphOrg: providerId: group: filter: securityEnabled eq false and mailEnabled eq true and groupTypes/any(c:c+eq+'Unified')
catalog: providers: microsoftGraphOrg: providerId: group: search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")'
catalog: providers: microsoftGraphOrg: providerId: group: select: ['id', 'displayName', 'description']
catalog: providers: microsoftGraphOrg: providerId: schedule: frequency: { hours: 1 }
catalog: providers: microsoftGraphOrg: providerId: schedule: timeout: { minutes: 50 }
catalog: providers: microsoftGraphOrg: providerId: schedule: initialDelay: { seconds: 15}
backend:start: {"class":"MicrosoftGraphOrgEntityProviderUSD1","level":"info","message":"Read 1 msgraph users and 1 msgraph groups in 2.2 seconds. Committing...","plugin":"catalog","service":"backstage","taskId":"MicrosoftGraphOrgEntityProvider:default:refresh","taskInstanceId":"88a67ce1-c466-41a4-9760-825e16b946be","timestamp":"2024-06-26 12:23:42"} backend:start: {"class":"MicrosoftGraphOrgEntityProviderUSD1","level":"info","message":"Committed 1 msgraph users and 1 msgraph groups in 0.0 seconds.","plugin":"catalog","service":"backstage","taskId":"MicrosoftGraphOrgEntityProvider:default:refresh","taskInstanceId":"88a67ce1-c466-41a4-9760-825e16b946be","timestamp":"2024-06-26 12:23:42"}