Question

I am able to get authorization token, but getting error at access Token, These are the steps I am doing now,

1.Obtain the code:

https://{host}/oauth2/endpoint/connectionsProvider/authorize?response_type=code&client_id=sample_application&redirect_uri=http://{host}

I got back something like:

http://{host}/?code=XMQPNpxCxkRCfIXMFbWiTQVD4PcM11

2.Try to get access token using: POST method:

POST https://{host}/oauth2/endpoint/connectionsProvider/token?grant_type=authorization_code&redirect_uri=http://{host}&client_id=sample_application&client_secret=pIEaHOQ6odz0Vr9fKTmiS0NgQF2uGAUDl2i9ZHS38qE7TGZD2nn3RcSl2bEI

With payload data as: code=XMQPNpxCxkRCfIXMFbWiTQVD4PcM11

In the 2nd steps only I am getting error.

Please advice me.

-WillSteel

Was it helpful?

Solution

Resolved the issue the problem was the header we were sending was MediaType.APPLICATION_JSON but the token end point api expects MediaType.APPLICATION_FORM_URLENCODED, so by changing the header the oauth flow worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top