Up to this point I have been using the “dev keys” for Google OAuth connections, and I am ready to use my own keys. I followed the Auth0 instructions for doing this. (I skipped step 2 because I believe it does not apply to me.) At step 4, testing the connection, I get an error. Here’s what shows up in the logs (<snip> replacing things that might be sensitive info).
Is the authorization failure coming from Google or Auth0? Any suggestions for diagnosing what’s invalid about the request? Since the request is coming from the test page, I assume it’s not that Auth0 is sending an invalid request, but I don’t know how to get more info.
I did a quick dive into similar topics with Google OAuth invalid request error and it seems like there might be a multiple reasons to it. Can you share the code you use for authentication (getting rid of sensitive data)?
I get that error when I hit the Try button in the social connections page. I don’t think it’s hitting any of my code. I hope I’m understanding your question correctly.
Done. Let me know if there’s anything else I can do to help diagnose it. I wouldn’t be surprised if it’s a configuration issue on my side, perhaps with my Google API setup. I’m hoping you have access to more info about why it’s failing.
Once you will be able to eventually establish what was the root cause with our developer support engineers, please share it with the rest of community in this thread!
Well, @konrad.sopala, this is my moment of the day. There was a space in the client secret, which is why the request was failing.
Thanks @marcus.baker for the help figuring this out!
For those stumbling upon this issue, please note that this mistake is really easy to make. Here’s what the page looks like in the Google API Console for configuring the credentials:
I edited the Client Secret part of the page to show that there are spaces before and after the client secret in the HTML element. Thus, if you copy-paste that field into the client secret field on the Auth0 side, it will come with spaces at the beginning and end of the string. Apparently I noticed the space at the end of the string and removed it, but I didn’t notice when I pasted it that there was a space at the beginning of the string. Unfortunately (and understandably) this manifests simply as “Unauthorized” so it’s a bit tricky to track down unless you look closely.
Thanks again Marcus and Konrad for helping me with this. I wish for my sake the root cause was something complicated, but in this case it was a good ol’ fashioned typo. So it goes.