I'm using office 365 graph api, while authentication(using postman) i am not getting refresh token. The access_token expires in 1 hour after that i have to again generate authentication code and then ask for new access_token. I have no option to refresh
the previous token.
Process I follow to get access_token:
- Send a get request to- https://login.microsoftonline.com/common/oauth2/v2.0/authorize with params: client_id : xxxxxxxxxxxxxxxxxxxxx, client_secret : xxxxxxxxxxxxxxxxxxxxx, response_type : code, redirect_uri :
http://localhost:8069, scope : Calendars.Read, response_mode : query, state : success, here i'll get code in response in the provided redirect_uri
- Then i'll send a post request to- https://login.microsoftonline.com/common/oauth2/v2.0/token with form-data: grant_type : authorization_code, code : xxxxxxxxxxxxxxxxxxxxxxx, client_secret : xxxxxxxxxxxxxxxxxxxxxxx, client_id : xxxxxxxxxxxxxxxxxxxxxxx, scope : Calendars.Read, redirect_uri
: http://localhost:8069,
In response, i am supposed to get-
{
"token_type": "Bearer",
"scope": "Calendars.Read",
"expires_in": 3600,
"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"refresh_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
But i am getting -
{
"token_type": "Bearer",
"scope": "Calendars.Read",
"expires_in": 3600,
"ext_expires_in": 3600,
"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
Please help