@@ -323,8 +323,8 @@ describe('UrlService Tests', () => {
323323 '&scope=openid%20email%20profile' +
324324 '&nonce=nonce' +
325325 '&state=state' +
326- '&prompt=myprompt ' +
327- '&to=add&as=well ' ;
326+ '&to=add&as=well ' +
327+ '&prompt=myprompt ' ;
328328
329329 expect ( value ) . toEqual ( expectValue ) ;
330330 } ) ;
@@ -623,6 +623,47 @@ describe('UrlService Tests', () => {
623623 expect ( value ) . toEqual ( expectValue ) ;
624624 } ) ;
625625
626+ it ( 'should add the prompt only once even if it is configured AND passed with `none` in silent renew case, taking the passed one' , ( ) => {
627+ const config = { authority : 'https://localhost:5001' } as OpenIdConfiguration ;
628+ config . clientId = '188968487735-b1hh7k87nkkh6vv84548sinju2kpr7gn.apps.googleusercontent.com' ;
629+ config . responseType = 'code' ;
630+ config . scope = 'openid email profile' ;
631+ config . redirectUrl = 'https://localhost:44386' ;
632+
633+ config . customParamsAuthRequest = {
634+ prompt : 'select_account' ,
635+ } ;
636+
637+ configurationProvider . setConfig ( config ) ;
638+ spyOn ( storagePersistenceService , 'read' )
639+ . withArgs ( 'authWellKnownEndPoints' , 'configId' )
640+ . and . returnValue ( { authorizationEndpoint : 'http://example' } ) ;
641+
642+ const value = ( service as any ) . createAuthorizeUrl (
643+ '' , // Implicit Flow
644+ config . redirectUrl ,
645+ 'nonce' ,
646+ 'state' ,
647+ 'configId' ,
648+ 'somePrompt'
649+ ) ;
650+
651+ const expectValue =
652+ 'http://example?client_id=188968487735-b1hh7k87nkkh6vv84548sinju2kpr7gn.apps.googleusercontent.com' +
653+ '&redirect_uri=https%3A%2F%2Flocalhost%3A44386' +
654+ '&response_type=code' +
655+ '&scope=openid%20email%20profile' +
656+ '&nonce=nonce' +
657+ '&state=state' +
658+ '&code_challenge=' +
659+ '&code_challenge_method=S256' +
660+ '&prompt=somePrompt' ;
661+
662+ expect ( value ) . toEqual ( expectValue ) ;
663+ } ) ;
664+ } ) ;
665+
666+ describe ( 'createRevocationEndpointBodyAccessToken' , ( ) => {
626667 it ( 'createRevocationBody access_token default' , ( ) => {
627668 const config = { authority : 'https://localhost:5001' } as OpenIdConfiguration ;
628669 config . redirectUrl = 'https://localhost:44386' ;
@@ -653,7 +694,9 @@ describe('UrlService Tests', () => {
653694
654695 expect ( value ) . toBeNull ( ) ;
655696 } ) ;
697+ } ) ;
656698
699+ describe ( 'createRevocationEndpointBodyRefreshToken' , ( ) => {
657700 it ( 'createRevocationBody refresh_token default' , ( ) => {
658701 const config = { authority : 'https://localhost:5001' } as OpenIdConfiguration ;
659702 config . redirectUrl = 'https://localhost:44386' ;
@@ -684,7 +727,9 @@ describe('UrlService Tests', () => {
684727
685728 expect ( value ) . toBeNull ( ) ;
686729 } ) ;
730+ } ) ;
687731
732+ describe ( 'getRevocationEndpointUrl' , ( ) => {
688733 it ( 'getRevocationEndpointUrl with params' , ( ) => {
689734 const config = { authority : 'https://localhost:5001' } as OpenIdConfiguration ;
690735 config . redirectUrl = 'https://localhost:44386' ;
0 commit comments