简体   繁体   中英

GAE app not recognized domain for signing in

I have a number of GAE-Standard Environment "Internal" Apps which use the javascript login. I've gone in and created the client_id and entered the domain as the javascript source for a new one, but it balks... 犹豫的屏幕截图

In order to resolve the redirect URI mismatch error with Javascript origin, you need to go to Google Cloud console and create an OAuth Client ID and set the redirect URI. Assuming that you haven't created an OAuth Client Id yet, see below steps on how to create it.

  1. Open the Google Cloud Console
  2. At the top-left, click Menu > APIs & Services > Credentials
  3. Click Credentials > OAuth Client ID
  4. Click Application type > Web application
  5. In the "Name" field, type a name for the credential. This name is only shown in the Cloud Console.
  6. Add authorized URIs related to your app:
    • Client-side apps (JavaScript) – Under Authorized JavaScript origins, click Add URI. Then, enter a URI to use for browser requests. This identifies the domains from which your application can send API requests to the OAuth 2.0 server.
    • Server-side apps (Java, Python, .NET, and more) – Under "Authorized redirect URIs," click Add URI. Then, enter an endpoint URI to which the OAuth 2.0 server can send responses.
  7. Click Create. The OAuth client created screen appears, showing your new Client ID and Client secret.
  8. Note the Client ID. Client secrets aren't used for Web applications.
  9. Click OK. The newly created credential appears under "OAuth 2.0 Client IDs."
  10. Optional: If you're creating credentials as a prerequisite for a JavaScript quickstart, you must also generate an API key.

在此处输入图像描述

On the other hand, if you already have an existing OAuth Client ID, on your OAuth 2.0 Client IDs Dashboard, click on Edit OAuth Client . Now, under Authorized Javascript Origins and Authorized redirect URLs add the redirect url, ie https://tamarackcId.appspot.com , then save it. Try to login again after a few minutes.

Note: Updating the Google API console and for the change to reflect can take some time. Redirect URIs are also case-sensitive and trailing-slash sensitive.

You can also refer to this OAuth client ID credentials guide.

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