chore: add common identify resolvers for oidc auth provider
Signed-off-by: mingfu <mingfu@alauda.io>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-auth-backend': patch
|
||||
---
|
||||
|
||||
Add common identify resolvers for `oidc` auth provider.
|
||||
@@ -641,7 +641,10 @@ export const providers: Readonly<{
|
||||
}
|
||||
| undefined,
|
||||
) => AuthProviderFactory;
|
||||
resolvers: never;
|
||||
resolvers: Readonly<{
|
||||
emailLocalPartMatchingUserEntityName: () => SignInResolver<unknown>;
|
||||
emailMatchingUserEntityProfileEmail: () => SignInResolver<unknown>;
|
||||
}>;
|
||||
}>;
|
||||
okta: Readonly<{
|
||||
create: (
|
||||
|
||||
@@ -44,6 +44,10 @@ import {
|
||||
SignInResolver,
|
||||
} from '../types';
|
||||
import { createAuthProviderIntegration } from '../createAuthProviderIntegration';
|
||||
import {
|
||||
commonByEmailLocalPartResolver,
|
||||
commonByEmailResolver,
|
||||
} from '../resolvers';
|
||||
|
||||
type PrivateInfo = {
|
||||
refreshToken?: string;
|
||||
@@ -255,4 +259,14 @@ export const oidc = 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,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user