python-keycloak
python-keycloak copied to clipboard
Does KeycloakOpenID.token() API support get the access token for a client only with clientId and client secret?
trafficstars
I have created a client in keycloak and configure Service Accounts Enabled to enabled.
I try to use API KeycloakOpenID.token() to get the access token for this client. When create the instance of KeycloakOpenID, I provided the clientId and client secret. and I call token() API as:
keycloak_openid.token(grant_type=["client_credentials"])
However, I got the exception and fail to get the token. When I use the post request it succeed.
I just wonder whether this token() support getting token with grant_type=["client_credentials"] ?
Thanks.
I guess you need to set the client to confidential. Which endpoint did you use for the post request?