Merge pull request #5093 from backstage/timbonicus/auth-config
Auth types fix + GitLab audience is optional
This commit is contained in:
@@ -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`
|
||||
Vendored
+9
-9
@@ -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`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user