Google API in Javascript

前端 未结 4 2012
半阙折子戏
半阙折子戏 2020-11-29 11:10

I am trying to get calendar info from google in javascript. I ve read \'how to\' manuals. They didn\'t help. Even this \'helpful\' copypasted code (to authorize) didn\'t. Wo

4条回答
  •  半阙折子戏
    2020-11-29 11:41

    i got the same error and as you preferred, after running html file in my local web server problem solved.

    i created credentials for web application and set following values both to my local with "http://localhost:5000" string

    "Authorized JavaScript origins" 
    "Authorized redirect URIs
    

    i checked the json file too. i got the following json file as a result.

    {"web":
     {
        "client_id":"myClientID",
        "project_id":"my-project",
        "auth_uri":"https://accounts.google.com/o/oauth2/auth",
        "token_uri":"https://accounts.google.com/o/oauth2/token",
        "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
        "client_secret":"XqXmgQGrst4xkZ2pgJh3Omxg",
        "redirect_uris":["http://localhost:5000"],
        "javascript_origins":["http://localhost:5000"]
     }
    

    }

    https://developers.google.com/drive/v2/web/auth/web-client

提交回复
热议问题