You only get access to the token if a Google user signs up on the Google login page.
Step 1: redirect https://accounts.google.com/o/oauth2/auth?client_id= "+ GoogleClientID +" & redirect_uri = "+ Url.Encode (GoogleRedirectURL) +" & response_type = code & scope = email "
Step 2: Now you are on the google login page and enter your google credentials.
Step 3: Google will redirect you back to the redirect_uri that you configured in the Google Developer Console, and you can get the "code" from QueryString
Step 4: Now you submit the form https://www.googleapis.com/oauth2/v4/token with client_id, client_secret, redirect_uri, code (you received in step 3) and grant_type = authorization_code
Result: you should now get access_token from Google
Rajat
source share