I'm trying to implement "login with Outlook.com" flow, which involves client and server code. The flow is:
- from the client redirect the user to:
I get the code back to my html page and post it to MY java server.
On the server side I use the code to obtain access and refresh token, using a POST request to: https://login.live.com/oauth20_token.srf
with the next parameters in the body: client_id, redirect_uri, client_secret, grant_type="authorization_code" and code=< the code from the previous step >.
I receive the access_token and refresh_tokem and they are supposed to valid for 1 hour.
- Still on the server, I call the URL
https://apis.live.net/v5.0/me?access_token=< the access-token I just got >
and get error 401:
{
"error": {
"code": "request_token_invalid",
"message": "The access token isn't valid."
}
}
Is this flow possible?