Hello everyone, hope you are doing well.
I want to use my Keycloak / Rancher realm defined users to connect my rancher-cli
to my Rancher.
When trying to generate the token and .rancher/cli2.json
, I have the following error:
Client side (rancher-cli)
% rancher token --user testuser --auth-provider keyCloakOIDCProvider --server https://myrancher.com
Enter credentials for keyCloakOIDCProvider
Enter username: testuser
Enter password:
FATA[0006] error logging in: code: [ServerError] message:[Server error while authenticating]
Server side (Rancher Server)
2023/03/14 15:28:12 [ERROR] API error response 500 for POST /v3-public/keyCloakOIDCProviders/keycloakoidc?action=login. Cause: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Code not valid"}
What does this error mean? Any idea ? Thank you in advance.