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.
- Open the Google Cloud Console
- At the top-left, click Menu > APIs & Services > Credentials
- Click Credentials > OAuth Client ID
- Click Application type > Web application
- In the "Name" field, type a name for the credential. This name is only shown in the Cloud Console.
- 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.
- Click Create. The OAuth client created screen appears, showing your new Client ID and Client secret.
- Note the Client ID. Client secrets aren't used for Web applications.
- Click OK. The newly created credential appears under "OAuth 2.0 Client IDs."
- 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.