jeudi 31 mars 2016

Why I'm not getting the refresh token (oath2) using Google accounts?

I used to develop an authentication module to my Web application which is developed with Angular2 using the Oauth2 Google+ API, the problem here is the google server response does not contain any refresh token besides to the access_token , expires_in , token_type , id_token keys ,I tried to revoke the access granted to my application and try again but still the same problem ; here are the parameters added in the POST query :

    code=4/BXlTY3dLzpUMfu4WuapGjn1du6TCVXEt6Wxjf7-EK_E
    &client_id=429410750270503bndl.apps.googleusercontent.com
    &client_secret=*****GZe11WEgy9Glg2T
    &grant_type=authorization_code
    &redirect_uri=http://localhost:3000/loginplus
    &access_type=offline

The problem is that in the official docs Google said that it should return a refresh_token but I'm not seeing it, I have only those mentioned above, here is the response

{
access_token: "ya29..tgLONwAAje6nNWmqV7bMJ_xBQQVS5ZUpXK7m5rCiJwIeeQZTw70fYjOGoX3Z9ZBMvA",
token_type: "Bearer",
expires_in: 3597,
id_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6IjA3YjlhZDg5ZWFhMTQxNW…bMdi_TtH998qaSdpL05EYG3_1bRijX6AFQwhUoe9ILJeOZM5w"
}

I searched a lot but none of the answers helped me, any help ??




Aucun commentaire:

Enregistrer un commentaire