IdentityModel / oidc-client-js

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
Apache License 2.0
2.43k stars 842 forks source link

UserManager.querySessionStatus: No silent_redirect_uri configured #1331

Closed IAMHK90 closed 3 years ago

IAMHK90 commented 3 years ago

Three Apps

IdentityServer4 with asp.net core identity (ID server)

Angular (client1)

VueJs (client2) The client is setup using code grant type

When I logout from client2 then client1 logouts as well which is the expected behaviour and working fine. However, When I logout from client1 then client2 doesn't logout and I see "UserManager.querySessionStatus: No silent_redirect_uri configured" error in console logs

var mgr = new Oidc.UserManager({ authority: "http://localhost:5001", client_id: "VueJs", redirect_uri: "http://localhost:8081/#/callback", response_type: 'code', scope: 'openid profilec', post_logout_redirect_uri: "http://localhost:8081", automaticSilentRenew: true, silent_redirect_uri: "http://localhost:8081/silent-renew.html", accessTokenExpiringNotificationTime: 60, filterProtocolClaims: true, loadUserInfo: true, revokeAccessTokenOnSignout: true, monitorSession: true })

brockallen commented 3 years ago

Configure one, or disable session monitoring.

IAMHK90 commented 3 years ago

@brockallen Sorry, I did not get what you meant by 'configure one'? I did set monitorSession to false, but no luck.

IAMHK90 commented 3 years ago

@brockallen, let me know if you need additional information

brockallen commented 3 years ago

Check the samples -- there's a regular callback endpoint and a silent callback endpoint.

https://github.com/IdentityModel/oidc-client-js/tree/dev/samples/VanillaJS/public

IAMHK90 commented 3 years ago

@brockallen, I did try exactly what was mentioned in that sample, but I still see the same error message in console log of client 2 application when I logout from client 1.

Error: UserManager.querySessionStatus: No silent_redirect_uri configured

IAMHK90 commented 3 years ago

We were not able to figure out that bug from past few months, just wondering why error message says ‘No silent_redirect_uri configured’ even though we configured it. Any clue ?

brockallen commented 3 years ago

No sorry, I don't know why your solution is not working. The code flow sample does work -- I'd suggest starting with that and find out where in your design it doesn't match.