Merge pull request #5093 from backstage/timbonicus/auth-config

Auth types fix + GitLab audience is optional
This commit is contained in:
Ben Lambert
2021-03-25 09:41:59 +01:00
committed by GitHub
3 changed files with 17 additions and 10 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-auth-backend': patch
---
The `auth` config types now properly accept any declared auth environment. Previously only `development` was accepted.
The `audience` configuration is no longer required for GitLab auth; this will default to `https://gitlab.com`
+9 -9
View File
@@ -36,13 +36,13 @@ export interface Config {
*/
providers?: {
google?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
github?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
gitlab?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
saml?: {
entryPoint: string;
@@ -55,10 +55,10 @@ export interface Config {
digestAlgorithm?: string;
};
okta?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
oauth2?: {
development: {
[authEnv: string]: {
clientId: string;
clientSecret: string;
authorizationUrl: string;
@@ -67,16 +67,16 @@ export interface Config {
};
};
oidc?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
auth0?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
microsoft?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
onelogin?: {
development: { [key: string]: string };
[authEnv: string]: { [key: string]: string };
};
awsalb?: {
issuer?: string;
@@ -122,7 +122,7 @@ export const createGitlabProvider = (
OAuthEnvironmentHandler.mapConfig(config, envConfig => {
const clientId = envConfig.getString('clientId');
const clientSecret = envConfig.getString('clientSecret');
const audience = envConfig.getString('audience');
const audience = envConfig.getOptionalString('audience');
const baseUrl = audience || 'https://gitlab.com';
const callbackUrl = `${globalConfig.baseUrl}/${providerId}/handler/frame`;