fix: adjusted to include the openID

This commit is contained in:
Wyatt Johnson
2018-10-25 10:31:43 -06:00
parent 977161db0a
commit e7131e1567
2 changed files with 11 additions and 1 deletions
@@ -75,6 +75,13 @@ export class JWTStrategy extends Strategy {
throw new Error("token could not be decoded");
}
// TODO: add OIDC support.
// At the moment, OpenID Connect tokens are not supported here directly,
// instead, the default implementation redirects the user to the
// authorization endpoint where they login, and a redirection occurs
// yielding the token to us via the Authorization Code Flow. We then issue a
// Talk Token for that request, that the client uses after.
// Handle SSO integrations.
if (this.verifiers.sso.supports(token, tenant)) {
return this.verifiers.sso.verify(tokenString, token, tenant);
@@ -343,7 +343,10 @@ export default class OIDCStrategy extends Strategy {
const { clientID, clientSecret, authorizationURL, tokenURL } = integration;
// Construct the callbackURL from the request.
const callbackURL = reconstructURL(req, "/api/tenant/auth/oidc/callback");
const callbackURL = reconstructURL(
req,
`/api/tenant/auth/oidc/${integration.id}/callback`
);
// Create a new OAuth2Strategy, where we pass the verify callback bound to
// this OIDCStrategy instance.