@@ -34,7 +34,8 @@ router.get('/', (_req, res) => {
34
34
function addOIDCRouterActivateWithTenant ( strategyName , callbackURI , redirectURL ) {
35
35
router . get ( callbackURI ,
36
36
passport . authenticate ( strategyName , {
37
- failureRedirect : 'error'
37
+ failureRedirect : 'error' ,
38
+ scope : 'openid profile'
38
39
} ) ,
39
40
( req , res ) => {
40
41
const userInfo = getSessionUser ( req ) ;
@@ -51,7 +52,8 @@ function addOIDCRouterActivateWithTenant(strategyName, callbackURI, redirectURL)
51
52
function addOIDCRouterActivate ( strategyName , callbackURI , redirectURL ) {
52
53
router . get ( callbackURI ,
53
54
passport . authenticate ( strategyName , {
54
- failureRedirect : 'error'
55
+ failureRedirect : 'error' ,
56
+ scope : 'openid profile'
55
57
} ) ,
56
58
( _req , res ) => {
57
59
res . redirect ( redirectURL ) ;
@@ -66,7 +68,8 @@ addOIDCRouterActivateWithTenant('oidcEntraActivateDistrictUser', '/callback_acti
66
68
67
69
router . get ( '/callback_bceid' ,
68
70
passport . authenticate ( 'oidcBceid' , {
69
- failureRedirect : 'error'
71
+ failureRedirect : 'error' ,
72
+ scope : 'openid profile'
70
73
} ) ,
71
74
( req , res ) => {
72
75
const userInfo = getSessionUser ( req ) ;
@@ -79,7 +82,8 @@ router.get('/callback_bceid',
79
82
80
83
router . get ( '/callback_entra' ,
81
84
passport . authenticate ( 'oidcEntra' , {
82
- failureRedirect : 'error'
85
+ failureRedirect : 'error' ,
86
+ scope : 'openid profile'
83
87
} ) ,
84
88
( req , res ) => {
85
89
const userInfo = getSessionUser ( req ) ;
@@ -110,14 +114,14 @@ router.get('/silent_sdc_idir_login', async function (req, res, next) {
110
114
res . status ( 401 ) . json ( UnauthorizedRsp ) ;
111
115
}
112
116
113
- const authenticator = passport . authenticate ( 'oidcIDIRSilent' , { failureRedirect : 'error' } ) ;
117
+ const authenticator = passport . authenticate ( 'oidcIDIRSilent' , { failureRedirect : 'error' , scope : 'openid profile' } ) ;
114
118
authenticator ( req , res , next ) ;
115
119
} ) ;
116
120
117
121
118
122
router . get (
119
123
'/callback_idir_silent_sdc' ,
120
- passport . authenticate ( 'oidcIDIRSilent' , { failureRedirect : 'error' } ) ,
124
+ passport . authenticate ( 'oidcIDIRSilent' , { failureRedirect : 'error' , scope : 'openid profile' } ) ,
121
125
async ( req , res ) => {
122
126
if ( ! req . session . passport . user . _json . idir_guid ) {
123
127
await res . redirect ( config . get ( 'server:frontend' ) + '/unauthorized' ) ;
@@ -143,7 +147,8 @@ router.get(
143
147
144
148
router . get ( '/callback_idir' ,
145
149
passport . authenticate ( 'oidcIDIR' , {
146
- failureRedirect : 'error'
150
+ failureRedirect : 'error' ,
151
+ scope : 'openid profile'
147
152
} ) ,
148
153
( req , res ) => {
149
154
const userInfo = getSessionUser ( req ) ;
@@ -161,7 +166,7 @@ router.get('/error', (_req, res) => {
161
166
162
167
function addBaseRouterGet ( strategyName , callbackURI ) {
163
168
router . get ( callbackURI , passport . authenticate ( strategyName , {
164
- scope : [ 'openid' , ' profile'] ,
169
+ scope : 'openid profile' ,
165
170
failureRedirect : 'error'
166
171
} ) ) ;
167
172
}
0 commit comments