Skip to content
Snippets Groups Projects
Commit c3f3d7bf authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Variablize the JWT lifetime

parent 89bf90d8
Branches
Tags
No related merge requests found
Pipeline #
......@@ -2,6 +2,9 @@ stages:
- build
- deploy
variables:
JWT_LIFETIME: 604800
build_development:
stage: build
only:
......
......@@ -17,6 +17,7 @@ services:
# - GLC_CLIENT_SECRET=${GLC_CLIENT_SECRET}
- LEGACY_MIDDLEWARE_URL=${LEGACY_MIDDLEWARE_URL}
- KONG_URL=${KONG_URL}
- JWT_LIFETIME=${JWT_LIFETIME} # in seconds
restart: unless-stopped
# depends_on:
# - redis
......
......@@ -345,7 +345,7 @@ export class AuthenticationService {
username: info.username,
iss: info.iss,
authzKey: info.authzKey,
exp: Math.floor(Date.now() / 1000) + (60 * 60 * 24 * 7), // 7 days
exp: Math.floor(Date.now() / 1000) + this.conf.jwtLifetime,
},
info.secret,
{
......
......@@ -26,6 +26,7 @@ export class ConfigService {
// this._config.post_logout_redirect_uri = process.env.POST_LOGOUT_REDIRECT_URI;
this._config.legacyMiddlewareUrl = process.env.LEGACY_MIDDLEWARE_URL;
this._config.kongConsumers = process.env.KONG_URL + '/consumers';
this._config.jwtLifetime = process.env.JWT_LIFETIME;
// this._config.providers.OIDC.discoveryUrl = process.env.OIDC_DISCOVERY_URL;
// this._config.providers.GLC.discoveryUrl = process.env.GLC_DISCOVERY_URL;
// Complete providers conf
......
......@@ -17,6 +17,7 @@ export const Config = {
// },
legacyMiddlewareUrl: '',
kongConsumers: '',
jwtLifetime: 3600,
// redis: {
// ttl: 300, // in seconds
// port: 6379,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment