Rename option from basicAuth to includeBasicAuth

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2021-12-07 11:55:04 +01:00
parent 8f461e6043
commit 13ae212d21
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -3,4 +3,4 @@
---
Fixes potential bug introduced in `0.4.10` which causes `OAuth2AuthProvider` to authenticate using credentials in both POST payload and headers.
This might break some stricter OAuth2 implementations so there is now a `basicAuth` config option that can manually be set to `true` to enable this behavior.
This might break some stricter OAuth2 implementations so there is now a `includeBasicAuth` config option that can manually be set to `true` to enable this behavior.
@@ -59,7 +59,7 @@ export type OAuth2AuthProviderOptions = OAuthProviderOptions & {
tokenUrl: string;
scope?: string;
logger: Logger;
basicAuth?: boolean;
includeBasicAuth?: boolean;
};
export class OAuth2AuthProvider implements OAuthHandlers {
@@ -86,7 +86,7 @@ export class OAuth2AuthProvider implements OAuthHandlers {
tokenURL: options.tokenUrl,
passReqToCallback: false as true,
scope: options.scope,
customHeaders: options.basicAuth
customHeaders: options.includeBasicAuth
? {
Authorization: `Basic ${this.encodeClientCredentials(
options.clientId,
@@ -247,7 +247,7 @@ export const createOAuth2Provider = (
const authorizationUrl = envConfig.getString('authorizationUrl');
const tokenUrl = envConfig.getString('tokenUrl');
const scope = envConfig.getOptionalString('scope');
const basicAuth = envConfig.getOptionalBoolean('basicAuth');
const includeBasicAuth = envConfig.getOptionalBoolean('includeBasicAuth');
const disableRefresh =
envConfig.getOptionalBoolean('disableRefresh') ?? false;
@@ -284,7 +284,7 @@ export const createOAuth2Provider = (
tokenUrl,
scope,
logger,
basicAuth,
includeBasicAuth,
});
return OAuthAdapter.fromConfig(globalConfig, provider, {