diff --git a/.changeset/afraid-mice-give.md b/.changeset/afraid-mice-give.md new file mode 100644 index 0000000000..8d6424f536 --- /dev/null +++ b/.changeset/afraid-mice-give.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Fixed an issue where some Okta's resolvers were missing diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index c269a09d2c..d80648a10f 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -592,6 +592,8 @@ export const providers: Readonly<{ | undefined, ) => AuthProviderFactory_2; resolvers: Readonly<{ + emailLocalPartMatchingUserEntityName: () => SignInResolver; + emailMatchingUserEntityProfileEmail: () => SignInResolver; emailMatchingUserEntityAnnotation(): SignInResolver; }>; }>; diff --git a/plugins/auth-backend/src/providers/okta/provider.ts b/plugins/auth-backend/src/providers/okta/provider.ts index 4c8d5c37d7..669914e7fc 100644 --- a/plugins/auth-backend/src/providers/okta/provider.ts +++ b/plugins/auth-backend/src/providers/okta/provider.ts @@ -24,6 +24,10 @@ import { adaptLegacyOAuthSignInResolver, } from '../../lib/legacy'; import { oktaAuthenticator } from '@backstage/plugin-auth-backend-module-okta-provider'; +import { + commonByEmailLocalPartResolver, + commonByEmailResolver, +} from '../resolvers'; /** * Auth provider integration for Okta auth @@ -51,6 +55,17 @@ export const okta = createAuthProviderIntegration({ }); }, resolvers: { + /** + * Looks up the user by matching their email local part to the entity name. + */ + emailLocalPartMatchingUserEntityName: () => commonByEmailLocalPartResolver, + /** + * Looks up the user by matching their email to the entity email. + */ + emailMatchingUserEntityProfileEmail: () => commonByEmailResolver, + /** + * Looks up the user by matching their email to the `okta.com/email` annotation. + */ emailMatchingUserEntityAnnotation(): SignInResolver { return async (info, ctx) => { const { profile } = info;