authts / oidc-client-ts

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
https://authts.github.io/oidc-client-ts/
Apache License 2.0
1.36k stars 207 forks source link

UserManager.signinRedirectCallback response_mode set "fragment",Error “Expected code in response” #1284

Open binyet opened 10 months ago

binyet commented 10 months ago

Dear, When I use method "UserManager.SigninRedirectCallback" to use code get token, it's catch an Error, is "Expected code in response". The first img is Debug Params, Debug

The Second img is SourceCode

SourceCode

when I use hash router in vue, method of 'URLSearchParams' unable to recognize the char of '#'.

pamapa commented 10 months ago

see https://github.com/authts/oidc-client-ts/blob/main/docs/index.md#hash-mode-router-spa

binyet commented 10 months ago

Thank you for your solution. But IdentityServer4 Application return the callback url. We can not modify the callback url.

pamapa commented 10 months ago

Thank you for your solution. But IdentityServer4 Application return the callback url. We can not modify the callback url.

I assume you are calling mgr.signinCallback(), thus you can modify the url parameter of it...