Meteor JS accounts-google package not working for me

前端 未结 2 1184
遇见更好的自我
遇见更好的自我 2020-12-15 01:57

I am a Meteor newbie and just ran into a problem using accounts-google (see below). All I did was follow the instructions on http://docs.meteor.com/#meteor_loginwithexternal

相关标签:
2条回答
  • 2020-12-15 02:24

    You need to meteor add service-configuration manually.

    The rest of your code looks good to me.

    You also need to make sure that you configured things correctly in the Google Developers Console.

    Add http://localhost:3000/_oauth/google?close in the REDIRECT URIS section, as well as http://localhost:3000/ for the JAVASCRIPT ORIGINS section.

    This is for testing purpose on localhost, you'll need to add your deployed app actual ROOT_URL (http://www.example.com/) when pushing to production.

    I addressed a similar problem here :

    Meteor.user is null after (apparently) successful login

    0 讨论(0)
  • 2020-12-15 02:43

    It turns out that in addition to meteor add service-configuration, you have to complete a minimum of all of the following in Google's API website:

    1. https://console.developers.google.com/project
    2. "Create Project"
    3. Wait for the project to be provisioned
    4. "API & auth" on the sidebar, "Credentials"
    5. "Create new Client ID"
    6. Paste in "Authorized JavaScript origin" and "Authorized Redirect URI"
    7. "Create Client ID"
    8. Copy the Client Secret and Client ID to your app configuration
    9. "API & auth" on the sidebar "Consent screen"
    10. Enter the field "Product Name" and save

    Steps 9 & 10 appear to be new requirements from Google in the past few days. See this Github ticket regarding the issue.

    0 讨论(0)
提交回复
热议问题