on ‎2018 Apr 30 11:46 AM
I'm trying to integrate Google Login in my application. I'm following this documentation : https://developers.google.com/identity/sign-in/web/server-side-flow
According to this doc, we need to include Gapi to our script to get 'oneTimeCode' from Google server upon button click event. I am able to get oneTimeCode , by creating a Google Web client in console.developers.google.com. We'll have to pass this oneTimeCode to our Back-end, so that our Back-end exchanges this oneTimeCode with Access tokens from Google (using GoogleAuthorizationCodeTokenRequest API). I'm trying to integrate Google Login from my localhost accelerator. While doing so I'm getting a 'Redirect URI' mismatch error, even after registering a redirect URI in my web app. Attached error below:
com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "redirect_uri_mismatch", "error_description" : "Bad Request" }
any help is greatly appreciated!
Request clarification before answering.
Hi, I resolved the issue. The reason is implicit google service requirements. The redirect_uri, which you send to google service (I am using GoogleAuthorizationCodeFlow), shouldn't be equal redirect_uri, which is set in that Auth client ID credentials record (google service). It should be equal that URI, which is marked as 'For use with requests from a browser' if there are several URIs, select that one, which sends an authCode to your backend.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.