@@ -372,6 +372,46 @@ describe('Client metadata validation', () => {
372372 } ) ;
373373 } ) ;
374374
375+ context ( 'post_logout_redirect_uris' , function ( ) {
376+ defaultsTo ( this . title , [ ] , undefined ) ;
377+ defaultsTo ( this . title , [ ] , { post_logout_redirect_uris : undefined } ) ;
378+ mustBeArray ( this . title , [ { } , 'string' , 123 , true ] ) ;
379+ rejects ( this . title , [ 123 ] , / m u s t o n l y c o n t a i n s t r i n g s $ / ) ;
380+
381+ allows ( this . title , [ 'http://some' ] , {
382+ application_type : 'web' ,
383+ } ) ;
384+ allows ( this . title , [ 'https://some' ] , {
385+ application_type : 'web' ,
386+ } ) ;
387+ rejects ( this . title , [ 'https://rp.example.com#' ] , / p o s t _ l o g o u t _ r e d i r e c t _ u r i s m u s t n o t c o n t a i n f r a g m e n t s $ / ) ;
388+ rejects ( this . title , [ 'https://rp.example.com#whatever' ] , / p o s t _ l o g o u t _ r e d i r e c t _ u r i s m u s t n o t c o n t a i n f r a g m e n t s $ / , {
389+ application_type : 'web' ,
390+ } ) ;
391+ rejects ( this . title , [ 'no-dot-reverse-notation:/some' ] , undefined , {
392+ application_type : 'web' ,
393+ } ) ;
394+ rejects ( this . title , [ 'https://localhost' ] , undefined , {
395+ application_type : 'web' ,
396+ grant_types : [ 'implicit' , 'authorization_code' ] ,
397+ response_types : [ 'code id_token' ] ,
398+ } ) ;
399+ allows ( this . title , [ 'http://localhost' ] , {
400+ application_type : 'web' ,
401+ } ) ;
402+ rejects ( this . title , [ 'http://some' ] , undefined , {
403+ application_type : 'native' ,
404+ } ) ;
405+ rejects ( this . title , [ 'not-a-uri' ] , undefined , {
406+ application_type : 'native' ,
407+ } ) ;
408+ rejects ( this . title , [ 'http://foo/bar' ] , undefined , {
409+ application_type : 'web' ,
410+ grant_types : [ 'implicit' ] ,
411+ response_types : [ 'id_token' ] ,
412+ } ) ;
413+ } ) ;
414+
375415 context ( 'request_object_signing_alg' , function ( ) {
376416 mustBeString ( this . title ) ;
377417 [
@@ -476,18 +516,6 @@ describe('Client metadata validation', () => {
476516 rejects ( this . title , 'not-a-type' ) ;
477517 } ) ;
478518
479- context ( 'post_logout_redirect_uris' , function ( ) {
480- defaultsTo ( this . title , [ ] , undefined ) ;
481- defaultsTo ( this . title , [ ] , { post_logout_redirect_uris : undefined } ) ;
482- mustBeArray ( this . title , undefined ) ;
483-
484- rejects ( this . title , [ 123 ] , / m u s t o n l y c o n t a i n s t r i n g s $ / , undefined ) ;
485- allows ( this . title , [ 'http://a-web-uri' ] , undefined ) ;
486- allows ( this . title , [ 'https://a-web-uri' ] , undefined ) ;
487- allows ( this . title , [ 'any-custom-scheme://not-a-web-uri' ] , undefined ) ;
488- rejects ( this . title , [ 'not a uri' ] , / m u s t o n l y c o n t a i n u r i s $ / , undefined ) ;
489- } ) ;
490-
491519 [
492520 'token_endpoint_auth_method' ,
493521 'introspection_endpoint_auth_method' ,
0 commit comments