Hi everyone, I am having difficulties making an introspect call to the endpoint using an Oauth 2 token of a client. The client is confidential and the call works fine if I use the basic auth username and password. I am not understanding why the call using Oauth 2 token authentication gives me back 401 {
"error": "invalid_request",
"error_description": "Authentication failed."
}
Ex. right now I am doing the following with Postman:
URL POST https:://{server}/realms/{customRealm}/protocol/openid-connect/token/introspect
Authorization is Basic Auth with Username: {username} and Password: {password}
Header has Content-Type: application/x-www-form-urlencoded
Body as application/x-www-form-urlencoded has token field with value {token}
This call works fine, giving me 200 OK for instance with body:
{
"active": false
}
But as soon as I switch to Oauth2 Authorization calling the token endpoint https://{server}/auth/realms/{customRealm}/protocol/openid-connect/token and getting a token with clientId and secret fields that are the same of th username and password of the basic auth and using that token, so mind, I get one, I receive 401 as explained before.
Could this have to do with the roles given to the client? If so could someone explain what the client should be set?