Merge pull request #6644 from JosiahCraw/feature/add-disableRefresh-config-for-oauth2

Feature/add disable refresh config for oauth2
This commit is contained in:
Tim Hansen
2021-07-28 20:34:20 -06:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': minor
---
Added the disableRefresh option to the OAuth2 config
@@ -177,6 +177,8 @@ export const createOAuth2Provider = (
const authorizationUrl = envConfig.getString('authorizationUrl');
const tokenUrl = envConfig.getString('tokenUrl');
const scope = envConfig.getOptionalString('scope');
const disableRefresh =
envConfig.getOptionalBoolean('disableRefresh') ?? false;
const provider = new OAuth2AuthProvider({
clientId,
@@ -188,7 +190,7 @@ export const createOAuth2Provider = (
});
return OAuthAdapter.fromConfig(globalConfig, provider, {
disableRefresh: false,
disableRefresh: disableRefresh,
providerId,
tokenIssuer,
});