@@ -221,12 +221,17 @@ define([
221
221
const pkInput = blocks . textarea ( ) ;
222
222
const pkLabel = blocks . labelledInput ( MyMessages . provider_saml_private , pkInput ) ;
223
223
224
+ // User name
225
+ const nameInput = blocks . input ( ) ;
226
+ const nameLabel = blocks . labelledInput ( MyMessages . provider_saml_name , nameInput ) ;
227
+
224
228
if ( isEdit ) {
225
229
urlInput . value = isEdit . url ;
226
230
issuerInput . value = isEdit . issuer || '' ;
227
231
idpcInput . value = isEdit . cert || '' ;
228
232
spcInput . value = isEdit . signingCert || '' ;
229
233
pkInput . value = isEdit . privateKey || '' ;
234
+ nameInput . value = isEdit . username_attr || '' ;
230
235
}
231
236
232
237
getValues = ( ) => {
@@ -237,7 +242,8 @@ define([
237
242
issuer : issuerInput . value ,
238
243
cert : idpcInput . value ,
239
244
signingCert : spcInput . value ,
240
- privateKey : pkInput . value
245
+ privateKey : pkInput . value ,
246
+ username_attr : nameInput . value
241
247
} ;
242
248
} ;
243
249
@@ -264,7 +270,7 @@ define([
264
270
const idAlgLabel = blocks . labelledInput ( MyMessages . provider_oidc_idalg , idAlgInput ) ;
265
271
266
272
// User Info alg
267
- const userAlgInput = blocks . input ( { placeholder : 'PS256' } ) ;
273
+ const userAlgInput = blocks . input ( ) ;
268
274
const userAlgLabel = blocks . labelledInput ( MyMessages . provider_oidc_useralg , userAlgInput ) ;
269
275
270
276
// PKCE
@@ -273,6 +279,12 @@ define([
273
279
// Nonce
274
280
const nonce = blocks . checkbox ( `sso-nonce-${ uid } ` , MyMessages . provider_oidc_nonce , true ) ;
275
281
282
+ // User name
283
+ const userScopeInput = blocks . input ( { placeholder :'profile' } ) ;
284
+ const userScopeLabel = blocks . labelledInput ( MyMessages . provider_oidc_userscope , userScopeInput ) ;
285
+ const userClaimInput = blocks . input ( { placeholder :'name' } ) ;
286
+ const userClaimLabel = blocks . labelledInput ( MyMessages . provider_oidc_userclaim , userClaimInput ) ;
287
+
276
288
if ( isEdit ) {
277
289
urlInput . value = isEdit . url || '' ;
278
290
cidInput . value = isEdit . client_id || '' ;
@@ -281,6 +293,8 @@ define([
281
293
userAlgInput . value = isEdit . userinfo_token_alg || isEdit . jwt_alg || '' ;
282
294
$ ( pkce ) . find ( 'input' ) . prop ( 'checked' , isEdit . use_pkce !== false ) ;
283
295
$ ( nonce ) . find ( 'input' ) . prop ( 'checked' , isEdit . use_nonce !== false ) ;
296
+ userScopeInput . value = isEdit . username_scope || '' ;
297
+ userClaimInput . value = isEdit . username_claim || '' ;
284
298
}
285
299
286
300
getValues = ( ) => {
@@ -293,10 +307,12 @@ define([
293
307
id_token_alg : idAlgInput . value || isEdit . jwt_alg || undefined ,
294
308
userinfo_token_alg : userAlgInput . value || isEdit . jwt_alg || undefined ,
295
309
use_nonce : $ ( nonce ) . find ( 'input' ) . is ( ':checked' ) ,
296
- use_pkce : $ ( pkce ) . find ( 'input' ) . is ( ':checked' )
310
+ use_pkce : $ ( pkce ) . find ( 'input' ) . is ( ':checked' ) ,
311
+ username_scope : userScopeInput . value ,
312
+ username_claim : userClaimInput . value ,
297
313
} ;
298
314
} ;
299
- $ ( form ) . append ( [ urlLabel , cidLabel , secretLabel , idAlgLabel , userAlgLabel , pkce , nonce ] ) ;
315
+ $ ( form ) . append ( [ urlLabel , cidLabel , secretLabel , idAlgLabel , userAlgLabel , pkce , nonce , userScopeLabel , userClaimLabel ] ) ;
300
316
} ) ;
301
317
302
318
if ( isEdit ) {
0 commit comments