feat: add common signIn resolver to more provider
- `providers.microsoft.resolvers.emailLocalPartMatchingUserEntityName()` - `providers.okta.resolvers.emailLocalPartMatchingUserEntityName()` Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
---
|
||||
'@backstage/plugin-auth-backend': patch
|
||||
---
|
||||
|
||||
Add common signIn resolver to more providers.
|
||||
|
||||
- `providers.microsoft.resolvers.emailLocalPartMatchingUserEntityName()`
|
||||
- `providers.okta.resolvers.emailLocalPartMatchingUserEntityName()`
|
||||
@@ -889,6 +889,7 @@ export const providers: Readonly<{
|
||||
| undefined,
|
||||
) => AuthProviderFactory;
|
||||
resolvers: Readonly<{
|
||||
emailLocalPartMatchingUserEntityName: () => SignInResolver<unknown>;
|
||||
emailMatchingUserEntityAnnotation(): SignInResolver<OAuthResult>;
|
||||
}>;
|
||||
}>;
|
||||
@@ -945,6 +946,7 @@ export const providers: Readonly<{
|
||||
| undefined,
|
||||
) => AuthProviderFactory;
|
||||
resolvers: Readonly<{
|
||||
emailLocalPartMatchingUserEntityName: () => SignInResolver<unknown>;
|
||||
emailMatchingUserEntityAnnotation(): SignInResolver<OAuthResult>;
|
||||
}>;
|
||||
}>;
|
||||
|
||||
@@ -43,6 +43,7 @@ import {
|
||||
AuthResolverContext,
|
||||
} from '../types';
|
||||
import { createAuthProviderIntegration } from '../createAuthProviderIntegration';
|
||||
import { commonByEmailLocalPartResolver } from '../resolvers';
|
||||
import { Logger } from 'winston';
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
@@ -270,6 +271,10 @@ export const microsoft = 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 `microsoft.com/email` annotation.
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,7 @@ import {
|
||||
AuthResolverContext,
|
||||
} from '../types';
|
||||
import { createAuthProviderIntegration } from '../createAuthProviderIntegration';
|
||||
import { commonByEmailLocalPartResolver } from '../resolvers';
|
||||
import { StateStore } from 'passport-oauth2';
|
||||
|
||||
type PrivateInfo = {
|
||||
@@ -274,6 +275,10 @@ 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 `okta.com/email` annotation.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user