I am creating an Android / iOS application that communicates with the Node.js server and would like to safely identify them on my server using Google (and / or Facebook) and OAuth2. I looked at the following documentation: https://developers.google.com/+/web/signin/server-side-flow
I do not need authorization, I only need authentication (I just want to make sure that the person calling my Node.js service is the person they say to). To achieve this, if I understand correctly, I must allow the user to log in using Google on the client side, this will give him an authorization code, which they can then give to my server. My server can then exchange this code for access_token and, therefore, get information about the user. I then guarantee that the user is the person to whom they say they are.
The Google documentation (link above) reads: "In the authorized redirect URI field, delete the default value. In this case, it is not used." However, in order for my server to exchange the authorization code for access_token, it must provide redirect_uri, did I miss something?
For example, it is redirect_uriuseless for Unity games (since logging in with Google simply opens a new "window" that closes when you log in, without redirection).
TL DR How do you use OAuth2 to authenticate users between my client and my server without redirecting?
source
share