fix(oidc): get all oidc parameters from env
This commit is contained in:
		| @@ -3,9 +3,17 @@ module.exports = { | ||||
|     sessionSecret: process.env.SESSION_SECRET, | ||||
|     oidc: { | ||||
|         gatewayUri: process.env.OIDC_GATEWAY_URI, | ||||
|         gatewayAuthUri: process.env.OIDC_GATEWAY_AUTH_URI, | ||||
|         gatewayTokenUri: process.env.OIDC_GATEWAY_TOKEN_URI, | ||||
|         gatewayUserinfoUri: process.env.OIDC_GATEWAY_USERINFO_URI, | ||||
|         clientId: process.env.OIDC_CLIENT_ID, | ||||
|         clientSecret: process.env.OIDC_CLIENT_SECRET, | ||||
|         redirectUris: process.env.OIDC_REDIRECT_URIS, | ||||
|         scopes: process.env.OIDC_AVAILABLE_SCOPES, | ||||
|         grantTypes: process.env.OIDC_GRANT_TYPES, | ||||
|         signedResponseAlg: process.env.OIDC_ID_TOKEN_SIGNED_RESPONSE_ALG, | ||||
|         responseTypes: process.env.OIDC_RESPONSE_TYPES, | ||||
|         authMethod: process.env.OIDC_TOKEN_ENDPOINT_AUTH_METHOD, | ||||
|     }, | ||||
|     wildDuck: { | ||||
|         url: process.env.WILDDUCK_URL, | ||||
|   | ||||
| @@ -29,17 +29,17 @@ export class AuthOidcService<ServiceParams extends AuthOidcParams = AuthOidcPara | ||||
|             client_id: config.get('oidc.clientId'), | ||||
|             client_secret: config.get('oidc.clientSecret'), | ||||
|             redirect_uris: [config.get('oidc.redirectUris')], | ||||
|             response_types: ['code'], | ||||
|             response_types: [config.get('oidc.responseTypes')], | ||||
|         }); | ||||
|         const codeVerifier = generators.codeVerifier(); | ||||
|         const codeChallenge = generators.codeChallenge(codeVerifier); | ||||
|  | ||||
|         const url = client.authorizationUrl({ | ||||
|             redirect_uri: config.get('clientUrl') + '/auth-oidc/callback', | ||||
|             scope: 'openid profile offline_access', | ||||
|             response_type: 'code', | ||||
|             scope: config.get('oidc.scopes'), | ||||
|             response_type: config.get('oidc.responseTypes'), | ||||
|             code_challenge: codeChallenge, | ||||
|             code_challenge_method: 'S256', | ||||
|             code_challenge_method: config.get('oidc.signedResponseAlg'), | ||||
|         }); | ||||
|  | ||||
|         params.session.codeVerifier = codeVerifier; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user