feat(auth): Auth0 frontend sign-in (custom ApiRef + provider registration)#121
Merged
Conversation
Auth0 has no built-in auth0AuthApiRef; define one in apis.ts backed by OAuth2 (provider id 'auth0' matches the auth-backend-module-auth0-provider), register the ApiBlueprint on the app module, and import the ref from ../apis (it was mistakenly imported from @backstage/core-plugin-api). SignInPage already wired to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables Auth0 SSO end-to-end (frontend + backend wiring). Resolves SSO users against the
people-namespaceUserentities from #120.Changes
Backend
@backstage/plugin-auth-backend-module-auth0-provider(provider idauth0) inpackages/backend/src/index.ts(+package.json/yarn.lock).Frontend (new frontend system)
packages/app/src/apis.ts— define a customauth0AuthApiRef(there's no built-in one in@backstage/core-plugin-api) and anauth0AuthApiBlueprintbacked byOAuth2(@backstage/core-app-api),provider.id: 'auth0', scopesopenid email profile.packages/app/src/overrides/app.tsx— import the ref/blueprint from../apis(was mistakenly imported from@backstage/core-plugin-api) and registerauth0Authon the app module.SignInPageshows guest in dev, the Auth0 button otherwise.Out of scope (deployment config)
auth.providers.auth0.<env>(clientId/secret/domain) +signIn.resolvers: [emailMatchingUserEntityProfileEmail]— matches the Auth0 email claim to the people users'spec.profile.email(@mozilla.com). Added in deployment-specific config.Testing
tsc -p tsconfig.jsonexit 0, app package lint clean, prettier clean.