I have successfully authenticated user and also got the authorization code but in the last step for token i am getting below error:
{
“error”: “invalid_client”,
“error_description”: “Client authentication failed. Either the client or the client credentials are invalid.”
}
Is it because the app i am trying to login is web application or is there something which is not right with my approach
If you are using a Web application within Okta, then the client auth is most likely set to Client Secret. Make sure you always use the correct client authentication when making your token request.
@andrea Thanks for response i was able to get the token after some amendments but when i am using the access token i am getting bad token. I compared the token which i get in browser and the one i generated in postman using jwt tool and it seems both have different signatures any idea how i can fix this as application does not seem to be recognizing the token.
Oh, like you have a resource server/API that you are sending the access tokens to as auth? What’s the issuer of the token for which you’re having issues validating the signature?
Yees we have default authorization server and also we have added Issuer i have used is same what is being passed in browser it is the my okta domain/oauth2/default/.well-known/openid-configuration but still both are different and the access token which i get from postman is not accepted in api call of the application which i have integrated.
Can you share the signature portion of the JWT that is failing to validate and the output of the /v1/keys endpoint for the same authorization server? Does the kid in the token signature not match one of the JWKs listed ad the /keys endpoint?