05-31-2019 06:11 AM
Dear Experts,
I am trying to fetch the access_token by directly calling the rest api as is done by cisco-identity-service-client-sdk, but facing some issue.
My steps/usecase is following:
- I hit following url, that took me to SAML login screen
https://{idsBaseUrl}/oauth/authorize?redirect_uri=https://localhost:8080&client_id={myclientId}&state={state}&response_type=code
where {idsBaseUrl}, {myclientId} and {state} are replaced by correct values.
- After login to SAML screen, it redirected me back to following url (as per my redirect url given):
https://localhost:8080/?state=aHR0cHM6Ly9sYWJmaW5lc3NlMTE2LmN5Y2xvbmVnbG9iYWwubmV0L2Rlc2t0b3Avc3NvL3Rlc3QJc3NvVGVzdFVybFJlcXVlc3Q%3D&code=669ea0b4875e38b0dc6bef217cf89fb6c2f87012
- I expect the code parameter in the above url is the authcode which needs to be send to access_token request. Am I right??
- Then I invoked following POST request to fetch access_token:
EndPoint URL: https://{idsBaseUrl}/oauth/access_token
Request Type: POST
Header: Accept: application/json
Header: Authorization: Basic xxxx (Base64 encoded clientId:clientSecret)
Body/Payload: code=669ea0b4875e38b0dc6bef217cf89fb6c2f87012&grant_type=authorization_code&redirect_uri=https://localhost:8080&return_user=yes
- But this request gives following response:
400, Bad Request
{"error":"invalid_request","error_description":"Missing grant_type parameter value"}
Any clues what I am doing wrong?
05-31-2019 09:46 AM
Hi,
Sorry, IdS and SSO is definitely not my strong point.
Based on the error you are getting:
{"error":"invalid_request","error_description":"Missing grant_type parameter value"}
I would try to figure out why it is saying grant_type is missing (which I see in your pasted body). Do you have the Content-Type set? Maybe use a debugger to see what is actually being sent.
Thanx,
Denise
06-03-2019 02:08 AM
06-03-2019 02:13 AM
06-03-2019 09:40 AM
Sorry, I don't know much about this...maybe others in the community can help...
01-20-2022 07:19 AM
@gauravmarch : did you ever get it working? I find myself in a similar boat... Thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide