-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid Grant error when deployed to Production #116
Comments
You need to check the server logs why you are getting the invalid_grant. I am sure it is a config problem. |
Thank you for you reply :) The server logs show the following:
The Production config is working fine for my ReactJS Web App using the implicit Grant Type, but my understand is authorization_code is better for a Desktop App with Refresh Tokens etc. My confusion is that I have the same configuration for the authorization_code on my local development environment which is working fine. I am not sure how to work out what config changes are needed between Local and Production. |
What's the allowed grant types for the client in production? |
In both Local & Production the Desktop Client is given GrantType "authorization_code" in the ClientGrantTypes table in SQL, however in Production its throwing this "Invalid grant type for client: "authorization_code"" error. |
First a big thank you to @leastprivilege for all your amazing work :)
I've inherited a solution that uses Identity Server 4 and is working well. While experimenting with this sample it works fine against localhost, but when trying to connect the Client to Production I'm getting:
'Invalid grant type for client: "authorization_code"'
I've been exploring the issue on StackOverflow:
https://stackoverflow.com/questions/69183994/identity-server4-gives-invalid-grant-error-when-deployed-to-production-but-wo?noredirect=1#comment122318014_69183994
...and the conclusion seems to be that in Production the Client also needs HTTPS. I suppose you have used this sample in Production against an SSL Secured Identity Server 4. Did you have any issues?
When changing the RedirectUri to HTTPS I get:
'HTTPS endpoints can only be configured using KestrelServerOptions.Listen().'
...and am now stuck in various loops trying to work out how to configure Kestrel and get Certificates onto Client machines to integrate into my solution. Just wanting to make sure I'm barking up the right tree and see if there is an easier way :)
Further reading of closed issue #89:
...in this Repo suggests that http loopback should still be fine in Production:
https://tools.ietf.org/html/rfc8252#section-7
...so I'm at loose end where I've gone wrong.
The text was updated successfully, but these errors were encountered: