简体   繁体   中英

google OAuth login for google Apps Script webapps

i have developed a google appscript webapp to which i want to add a login using google id option. the web is based on appscript. the html portion is also on appscript. After going through the instruction on the guide page of google oauth i am completely confused. google OAuth is needed only for getting the users details ie email id , name etc

Based on your last comment, I see that you got the error « Error: redirect_uri_mismatch The JavaScript origin in the request, n-tk3g6s4u5jztr6tiwt4qn2j5ze3taoymlgdpaci-0lu-script.googleuser… , does not match the ones authorized for the OAuth client. Visit console.developers.google.com/apis/credentials/oauthclient/… to update the authorized JavaScript origins ». This error appears because you are using a URI not authorized by your current OAuth credentials. You can easily solve that error with the following steps.

PROCEDURE

  1. Open a new browser tab and go to Credentials on your APIs & Services menu.
  2. Select your project on the top bar.
  3. On the OAuth 2.0 Client IDs menu you will find your authorized URIs. If you click on each name, you will see its associated URI. Your URI should match any of them for your web-app to work. Click on the name of any credential under OAuth 2.0 Client IDs to continue.
  4. Modify the URI under URIs (or add a different one clicking +Add URI ).
  5. Click on Save .

Now your URI will be authorised and, as a result, you won't encounter the same error. This configuration will be effective in some minutes, but sometimes it could last longer. Don't hesitate to write me back with any additional question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM