From dc29ab24111afc06aa443d703ac807e2fccef25e Mon Sep 17 00:00:00 2001 From: Severin Wischmann Date: Mon, 26 Feb 2024 16:47:44 +0100 Subject: [PATCH] Fix for atlassian OAuth flow Signed-off-by: Severin Wischmann --- .../src/authenticator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/auth-backend-module-atlassian-provider/src/authenticator.ts b/plugins/auth-backend-module-atlassian-provider/src/authenticator.ts index 3e5ed50246..6f3309a4ab 100644 --- a/plugins/auth-backend-module-atlassian-provider/src/authenticator.ts +++ b/plugins/auth-backend-module-atlassian-provider/src/authenticator.ts @@ -14,13 +14,13 @@ * limitations under the License. */ -import { Strategy as AtlassianStrategy } from 'passport-atlassian-oauth2'; import { createOAuthAuthenticator, PassportOAuthAuthenticatorHelper, PassportOAuthDoneCallback, PassportProfile, } from '@backstage/plugin-auth-node'; +import { Strategy as AtlassianStrategy } from 'passport-atlassian-oauth2'; /** @public */ export const atlassianAuthenticator = createOAuthAuthenticator({ @@ -30,7 +30,7 @@ export const atlassianAuthenticator = createOAuthAuthenticator({ const clientId = config.getString('clientId'); const clientSecret = config.getString('clientSecret'); const baseUrl = - config.getOptionalString('audience') || 'https://atlassian.com'; + config.getOptionalString('audience') || 'https://api.atlassian.com'; return PassportOAuthAuthenticatorHelper.from( new AtlassianStrategy( @@ -39,7 +39,7 @@ export const atlassianAuthenticator = createOAuthAuthenticator({ clientSecret: clientSecret, callbackURL: callbackUrl, baseURL: baseUrl, - authorizationURL: `${baseUrl}/oauth/authorize`, + authorizationURL: `${baseUrl}/authorize`, tokenURL: `${baseUrl}/oauth/token`, profileURL: `${baseUrl}/api/v4/user`, },