Forums

Error 400: invalid_request Permission denied to generate login hint for target domain.

I was able to successfully integrate Google Sign-in via Javascript on my pythonanywhere site but after checking on it recently it suddenly broke. Under Authorized JavaScript origins, I have a link to the site (not its IP address) but I'm still getting the error listed in the title. I'm not getting this error when I'm testing it locally so I was wondering if this was possibly related to recent changes made to pythonanywhere.

We haven't made any changes to PythonAnywhere since 11 March, and I don't think that the changes that we made then would be likely to cause an error like that. Where are you seeing that error?

The error comes up after I try to click the sign in button on the page. A popup comes up which is supposed to prompt the user to sign in/choose an account but instead the error comes on. I was following this guide that Google had posted when setting everything up. I thought that maybe this StackOverflow post would've helped but again I've included the website domain directly and not its IP address.

perhaps double check that you do still have it enabled under google for the domain that you are using?

I do have it enabled under google for the domain. Interestingly enough, if i remove http://localhost:8000 from the list of domain names and try to test it locally, I get an error different than what I'm getting on my live website. (Error 400: redirect_uri_mismatch The JavaScript origin in the request, http://localhost:8000, does not match the ones authorized for the OAuth client), and removing the domain for my live website does not change the error message that is displayed.

I do have it enabled under google for the domain. Interestingly enough, if i remove http://localhost:8000 from the list of domain names and try to test it locally, I get an error different than what I'm getting on my live website. (Error 400: redirect_uri_mismatch The JavaScript origin in the request, http://localhost:8000, does not match the ones authorized for the OAuth client), and removing the domain for my live website does not change the error message that is displayed.

Perhaps you could share a screenshot of the settings you have on the list of authorized origins?

Yeah sure. Here's a link the screenshot.

That all looks fine to me. Perhaps one for Stack Overflow? Though I see that there are a number of posts there already about similar problems, and in each case the problem was simply that the person posting was doing things locally, or didn't have the authorized origins set correctly...

Yeah I saw those posts too. I had also tried making a Stack Overflow post but unfortunately there has not been any responses on there. Is there a way I could reach out to Google about this?

You need to try on https://support.google.com/

Oh okay cool thanks. I was looking through it though and it didn't seem like there was a section related to integrating Google Sign-In on a website? The nav bar on this page makes me think it'd be under "Google Identity", but scrolling through the options there doesn't seem to be anything for that or anything related to Google Sign-In.

Sorry, do you mean that you didn't find what you were looking for at the Google help page you linked to?

Sorry I meant that I tried looking for help at https://support.google.com/ but I couldn't find anything that was related to my issue.

Oh, I see. But you actually pasted the link that looked relevant.

Did you get any further with the above issue? I didn't have any issues before and could always log in fine, but now I have the identical issue. Also can't figure this out looking at any stackoverflow posts.

No news from our side -- I don't know if @lywilliam managed to find anything, though.

Unfortunately I still haven't been able to find anything new. I opened an issue on their GitHub page though so hopefully they respond soon.

Thanks so much!