mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Merge pull request #272 from ets-cfuhrman-pfe/debug-oidc-1
Some checks failed
CI/CD Pipeline for Backend / build_and_push_backend (push) Failing after 18s
CI/CD Pipeline for Nginx Router / build_and_push_nginx (push) Failing after 17s
CI/CD Pipeline for Frontend / build_and_push_frontend (push) Failing after 17s
Tests / lint-and-tests (client) (push) Failing after 1m5s
Tests / lint-and-tests (server) (push) Failing after 1m2s
Some checks failed
CI/CD Pipeline for Backend / build_and_push_backend (push) Failing after 18s
CI/CD Pipeline for Nginx Router / build_and_push_nginx (push) Failing after 17s
CI/CD Pipeline for Frontend / build_and_push_frontend (push) Failing after 17s
Tests / lint-and-tests (client) (push) Failing after 1m5s
Tests / lint-and-tests (server) (push) Failing after 1m2s
userModel traces
This commit is contained in:
commit
1b06af0b70
4 changed files with 15 additions and 9 deletions
|
|
@ -103,8 +103,7 @@ app.use(session({
|
||||||
cookie: { secure: process.env.NODE_ENV === 'production' }
|
cookie: { secure: process.env.NODE_ENV === 'production' }
|
||||||
}));
|
}));
|
||||||
|
|
||||||
let authManager = new AuthManager(app,null,userModel);
|
let _authManager = new AuthManager(app,null,userModel);
|
||||||
authManager.getUserModel();
|
|
||||||
app.use(errorHandler);
|
app.use(errorHandler);
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ const AppError = require('../middleware/AppError.js');
|
||||||
|
|
||||||
class AuthManager{
|
class AuthManager{
|
||||||
constructor(expressapp,configs=null,userModel){
|
constructor(expressapp,configs=null,userModel){
|
||||||
|
console.log(`AuthManager: constructor: configs: ${JSON.stringify(configs)}`);
|
||||||
|
console.log(`AuthManager: constructor: userModel: ${JSON.stringify(userModel)}`);
|
||||||
this.modules = []
|
this.modules = []
|
||||||
this.app = expressapp
|
this.app = expressapp
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,16 +23,20 @@ class PassportOpenIDConnect {
|
||||||
|
|
||||||
async register(app, passport, endpoint, name, provider, userModel) {
|
async register(app, passport, endpoint, name, provider, userModel) {
|
||||||
|
|
||||||
|
console.log(`oidc.js: register: endpoint: ${endpoint}`);
|
||||||
|
console.log(`oidc.js: register: name: ${name}`);
|
||||||
|
console.log(`oidc.js: register: provider: ${JSON.stringify(provider)}`);
|
||||||
|
console.log(`oidc.js: register: userModel: ${JSON.stringify(userModel)}`);
|
||||||
|
|
||||||
const config = await this.getConfigFromConfigURL(name, provider);
|
const config = await this.getConfigFromConfigURL(name, provider);
|
||||||
const cb_url = `${process.env['OIDC_URL']}${endpoint}/${name}/callback`;
|
const cb_url = `${process.env['OIDC_URL']}${endpoint}/${name}/callback`;
|
||||||
const self = this;
|
const self = this;
|
||||||
const scope = 'openid profile email ' + `${provider.OIDC_ADD_SCOPE}`;
|
const scope = 'openid profile email ' + `${provider.OIDC_ADD_SCOPE}`;
|
||||||
|
|
||||||
console.log(config);
|
console.log(`oidc.js: register: config: ${JSON.stringify(config)}`);
|
||||||
console.log('');
|
console.log(`oidc.js: register: cb_url: ${cb_url}`);
|
||||||
console.log(cb_url);
|
console.log(`oidc.js: register: scope: ${scope}`);
|
||||||
console.log('');
|
|
||||||
console.log(scope);
|
|
||||||
passport.use(name, new OpenIDConnectStrategy({
|
passport.use(name, new OpenIDConnectStrategy({
|
||||||
issuer: config.issuer,
|
issuer: config.issuer,
|
||||||
authorizationURL: config.authorization_endpoint,
|
authorizationURL: config.authorization_endpoint,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ class PassportJs{
|
||||||
}
|
}
|
||||||
|
|
||||||
async registerAuth(expressapp, userModel){
|
async registerAuth(expressapp, userModel){
|
||||||
|
console.log(`PassportJs: registerAuth: userModel: ${JSON.stringify(userModel)}`);
|
||||||
expressapp.use(passport.initialize());
|
expressapp.use(passport.initialize());
|
||||||
expressapp.use(passport.session());
|
expressapp.use(passport.session());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue