Internal Server Error in OAuth for Google

为君一笑 提交于 2020-01-07 07:44:10

问题


EDIT: I was able to resolve the original error here when I realized my ROOT URL was set to my IP address rather than my domain. However, I now have a new issue. My client ID is the same as the original post below. This works fine in the local app, but in production, the popup flashes for a second and then the login box displays "Internal Server Error". I can't see any other messages that would explain it.

I am using the service-configuration package to load the settings, as follows:

ServiceConfiguration.configurations.upsert(
    { service: "google" },
        {
            $set: {
                clientId: "************",
                loginStyle: "popup",
                secret: "***********"
            }
        }
);

If I add ?close to the end of my Authorized redirect URI, the Google popup comes up with a redirect_uri_mismatch error, showing the URI without ?close. I think there was an issue resolved here but it at least shows me that my project in Google is being recognized.

ORIGINAL POST I am setting up an OAuth 2.0 client ID for accounts-google in Meteor and am seeing the following error:

400. That’s an error.
Error: invalid_request
Invalid parameter value for redirect_uri: Raw IP addresses not allowed:
http://***.***.***.***/_oauth/google

My Client ID in Google:

Authorized Javascript Origins
http://localhost:3000
http://myApp.com

Authorized redirect URIs
http://localhost:3000/_oauth/google
http://myApp.com/_oauth/google

I understand I must not be properly pointing the domain to the IP address. I have already set up an A record and the site works fine in other regards though, so not sure what step I missed.

来源:https://stackoverflow.com/questions/38468374/internal-server-error-in-oauth-for-google

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!