Implicit flow - pass token in query string instead of header
Hi guys, Thanks for the great work you've done on this complex matter.
My question is related to passing the authentication token from a JS client with implicit flow. I have a standard configuration of ID server, API and JS client - all running on different hosts. Mainly because of CORS issues I can't use the Authorization header to pass the token. I need to use URL parameter. I guess this might be quite straight-forward and I did find some examples on what should be done with ID server 3, but I can't figure out how this can be applied to ID server 4.
What should I configure in IdentityServerAuthenticationOptions on API side when registering the middleware with UseIdentityServerAuthentication in order to allow the middleware to get the token from query srting? Or may be this there is a different way this is done?
Thank you for your time!
There is a func that you can implement to retrieve the token from arbitrary parts of the the http request see here:
https://github.com/IdentityServer/IdentityServer4.AccessTokenValidation/blob/dev/src/IdentityServer4.AccessTokenValidation/IdentityServerAuthenticationOptions.cs#L43
Thanks for the quick reply!
In the meanwhile i found this post which might do the trick http://infozone.se/en/authenticate-against-signalr-2/ but your suggestion seems to be the clean way to go.
New link: https://github.com/IdentityServer/IdentityServer4.AccessTokenValidation/blob/8181a5b4c48b3e5e9318698fbfd110c0e7c01990/src/IdentityServerAuthenticationOptions.cs#L45
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.