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:
David Zemon
2022-06-30 09:32:24 -05:00
parent 3a6f3536f3
commit 35233735e8
3 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -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,