feat: [#12248] Switch to new okta strategy
This new Okta passport strategy support custom authorization server IDs Signed-off-by: David Zemon <david@zemon.name>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
"@backstage/config": "^1.0.1",
|
||||
"@backstage/errors": "^1.1.0-next.0",
|
||||
"@backstage/types": "^1.0.0",
|
||||
"@davidzemon/passport-okta-oauth": "^0.0.4-2",
|
||||
"@google-cloud/firestore": "^5.0.2",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/passport": "^1.0.3",
|
||||
@@ -68,7 +69,6 @@
|
||||
"passport-google-oauth20": "^2.0.0",
|
||||
"passport-microsoft": "^1.0.0",
|
||||
"passport-oauth2": "^1.6.1",
|
||||
"passport-okta-oauth": "^0.0.1",
|
||||
"passport-onelogin-oauth": "^0.0.1",
|
||||
"passport-saml": "^3.1.2",
|
||||
"uuid": "^8.0.0",
|
||||
|
||||
@@ -55,6 +55,7 @@ type PrivateInfo = {
|
||||
|
||||
export type OktaAuthProviderOptions = OAuthProviderOptions & {
|
||||
audience: string;
|
||||
authServerId?: string;
|
||||
signInResolver?: SignInResolver<OAuthResult>;
|
||||
authHandler: AuthHandler<OAuthResult>;
|
||||
resolverContext: AuthResolverContext;
|
||||
@@ -94,6 +95,7 @@ export class OktaAuthProvider implements OAuthHandlers {
|
||||
clientSecret: options.clientSecret,
|
||||
callbackURL: options.callbackUrl,
|
||||
audience: options.audience,
|
||||
authServerID: options.authServerId,
|
||||
passReqToCallback: false,
|
||||
store: this.store,
|
||||
response_type: 'code',
|
||||
@@ -220,6 +222,7 @@ export const okta = createAuthProviderIntegration({
|
||||
const clientId = envConfig.getString('clientId');
|
||||
const clientSecret = envConfig.getString('clientSecret');
|
||||
const audience = envConfig.getString('audience');
|
||||
const authServerId = envConfig.getString('authServerId');
|
||||
const customCallbackUrl = envConfig.getOptionalString('callbackUrl');
|
||||
const callbackUrl =
|
||||
customCallbackUrl ||
|
||||
@@ -240,6 +243,7 @@ export const okta = createAuthProviderIntegration({
|
||||
|
||||
const provider = new OktaAuthProvider({
|
||||
audience,
|
||||
authServerId,
|
||||
clientId,
|
||||
clientSecret,
|
||||
callbackUrl,
|
||||
|
||||
Reference in New Issue
Block a user