I am using spring social google sign in to login to my spring mvc based web application.
When I try to signin using google I get following error.
The redirect URI in the request, http://localhost:8080/gen/auth/google, does not match the ones authorized for the OAuth client.
Visit https://console.developers.google.com/apis/credentials/oauthclient/1014044541-l70us8boluo4a.apps.googleusercontent.com?project=1011 to update the authorized redirect URIs.
I have added the redirect uri in google console developer. It is different from what is getting passed in while signing using google.
I have given url as http://localhost:8080/gen/home in google console but it tries to go to http://localhost:8080/gen/auth/google, which is not there in google dev console. It's a mismatch here.
So, how and where do I need to specify the redirect uri in the application?
You should keep in mind the following considerations:
So you must to provide a reacheable host, not localhost. Try something like dyndns domain (e.g. custom.dyndns.org) and change all the network stuff to allow the incoming traffic to your host specific port
In this link you will find that if you configure the SocialAuthenticationFilterCheck "it will listen to URL’s that start with /auth and route incoming requests to the corresponding social network provider. E.g. a request sent to /auth/facebook will be redirected to the Facebook provider"
Finally you will have a reachable endpoint like http://custom.dyndns.org:8080/gen and then your 'redirect_uri' must be http://custom.dyndns.org:8080/gen/auth/google