# Unable to login with api using keycloak oidc user

**URL:** <https://forums.suse.com/t/unable-to-login-with-api-using-keycloak-oidc-user/41680>\
**Category:** SUSE Rancher Prime\
**Created:** [October 2, 2023, 2:22pm UTC](https://forums.suse.com/t/unable-to-login-with-api-using-keycloak-oidc-user/41680 "2023-10-02T14:22:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuelbartel](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/samuelbartel/32/10571_2.png) [@samuelbartel](https://forums.suse.com/u/samuelbartel)\
**Post date:** [October 2, 2023, 2:22pm UTC](https://forums.suse.com/t/unable-to-login-with-api-using-keycloak-oidc-user/41680/1 "2023-10-02T14:22:57Z")

</div>

Hello,  
I have setup keycloak odic authprovider for rancher and i have created user on keycloak.  
Using the GUI i can connect to rancher using the keycloak odic.

When I try to do the same using the api it doesn’t work  
i have try to generate directly a token from keycloak protocol/openid-connect/token but the generate token is not recongnized by rancher i got an authentication failed when trying to use it as BEARER token

When I try to usr the rancher keycloak oidc provider url from the public api (v3-public/keyCloakOIDCProviders/keycloakoidc?action=login) i got 404 error on the redireection to rancher verif-auth url

I understand that everything doable from the gui can be achieve using the API.  
What is the correct workflow to authenticate with a keycloak user to rancher using the API? any documentation or example around?
