mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
fix: update keycloak example (#478)
This commit is contained in:
parent
67ad9c4498
commit
af0a33434a
@ -20,9 +20,9 @@ const { User, AuthenticationRequired } = require('../lib/server-impl.js');
|
|||||||
const KeycloakStrategy = require('@exlinc/keycloak-passport');
|
const KeycloakStrategy = require('@exlinc/keycloak-passport');
|
||||||
const passport = require('passport');
|
const passport = require('passport');
|
||||||
|
|
||||||
const host = `http://${process.env.AUTH_HOST}`;
|
const host = process.env.AUTH_HOST;
|
||||||
const realm = process.env.AUTH_REALM;
|
const realm = process.env.AUTH_REALM;
|
||||||
const clientId = process.env.AUTH_CLIENT_ID;
|
const clientID = process.env.AUTH_CLIENT_ID;
|
||||||
const contextPath = process.env.CONTEXT_PATH;
|
const contextPath = process.env.CONTEXT_PATH;
|
||||||
|
|
||||||
passport.use(
|
passport.use(
|
||||||
@ -31,12 +31,12 @@ passport.use(
|
|||||||
{
|
{
|
||||||
host,
|
host,
|
||||||
realm,
|
realm,
|
||||||
clientId,
|
clientID,
|
||||||
clientSecret: "We don't need that, but is required",
|
clientSecret: "We don't need that, but is required",
|
||||||
callbackURL: `${contextPath}/api/auth/callback`,
|
callbackURL: `${contextPath}/api/auth/callback`,
|
||||||
authorizationURL: `${host}/auth/realms/hamis/protocol/openid-connect/auth`,
|
authorizationURL: `${host}/auth/realms/${realm}/protocol/openid-connect/auth`,
|
||||||
tokenURL: `${host}/auth/realms/hamis/protocol/openid-connect/token`,
|
tokenURL: `${host}/auth/realms/${realm}/protocol/openid-connect/token`,
|
||||||
userInfoURL: `${host}/auth/realms/hamis/protocol/openid-connect/userinfo`,
|
userInfoURL: `${host}/auth/realms/${realm}/protocol/openid-connect/userinfo`,
|
||||||
},
|
},
|
||||||
|
|
||||||
(accessToken, refreshToken, profile, done) => {
|
(accessToken, refreshToken, profile, done) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user