-
-
Notifications
You must be signed in to change notification settings - Fork 102
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 type when trying with google #126
Comments
Hmm... the Google example seems to work with the client credentials in the The other main difference I see with the Google example is PKCE. I would try temporarily disabling PKCE and making sure it works in case you're somehow passing in a mismatched PKCE verifier. Since you included a browser devtools screenshot, does this mean you're using the crate via WASM? It should work using WASM, but I haven't specifically tested WASM against Google, so it's possible there's a browser interoperability quirk I'm not aware of. Although, if this happening inside a browser, it probably doesn't make sense to use a client secret since a browser app isn't able to keep a secret away from end users. I believe Google lets you specify the app type during registration so that it doesn't assign a client secret for public apps. |
I am indeed running in WASM. I've also tried to run it without the PKCE, but I have the same result |
Did you try |
sorry for the late reaction. I did try that yes, but it didn't make a difference as I had already managed to move those values by setting custom values. Which I now no longer need to do. the thing I find most weird though is that the request seems fine. but I don't get the error, like there isn't a |
the missing |
What would an example code look like to pass a customized reqwest module? The docs says impl this trait but it's very vague. |
Actually never mind, I found: https://github.com/ramosbugs/oauth2-rs/blob/main/src/reqwest.rs |
I created a fullstack Rust/WASM example here: https://github.com/dakom/dominator-workers-fluent-auth Frontend is using Dominator, but the oauth/openid part happens on the backend, using Cloudflare Workers in Rust/WASM I know this is not a pretty solution, but it works: a custom http_client impl using native web_sys Request/Response types. No live demo there but I've tested with beta client id/secrets w/ both Google and Facebook: |
I am trying to implement SSO for a leptos app I am making but I am stuck at the code exchange phase. I've tried a lot of things but am basically about to give up.
I have the following code:
but whenever I call exchange I get a 400 response from google
I have notices a couple of things. According to google I need the client id and secret as fields in the post data, those are missing (I believe those are encoded into the authorization header?), so I added those in the dirty way with the extra params. another thing I noticed is that the code I have is a lot longer than the one shown in the google documentation, although I reckon this is not a problem.
p.s. I redacted the client id and secret for hopefully obvious reasons
The text was updated successfully, but these errors were encountered: