Hi,
I have to been trying to authenticate with authorization_code flow.
I followed the postman tutorial and it was working fine. I was able to get the access code.
But, I tried the same from cURL. Tough I have passed the token exactly as I received in the authorize API response, I have always been getting the following error response.
{"error":"invalid_grant","error_description":"Code not valid"}%
Here is the cURL.
I have been sending the following items to the token URL (https://api.fusionfabric.cloud/login/v1/sandbox/oidc/token)
- client_secret
- client_id
- code (as receieved in authorize call)
- grant_type (authorization_code)
- redirect_uri (one of URLs added in the app)
Additionally, setting 'Content-Type: application/x-www-form-urlencoded' in the header.
I have made sure that I am passing all other params right too.
What could be the issue here?
- Is it any parameter I am missing?
- Are you considering similarity in the user-agent
- In postman, for getting token, I see some Bearer-Token is passed in the header? What is it? Is it needed?
I also have tried the 'Private Key Authentication'. Even if I pass the private_key_jwt, it is asking for the client_secret which again is against its purpose. Even then, I am getting the same error as above.
Please help me cross this blocker.