ImportError: cannot import name 'KeycloakOpenID'

Question:

How do I fix this error? Python 3.7.3, linux, keycloak==3.0.0

ImportError: cannot import name 'KeycloakOpenID' from 'keycloak' (/usr/local/lib/python3.7/dist-packages/keycloak/__init__.py)

cmd:

from keycloak import KeycloakOpenID

But the command import keycloak succeeds. Also I’ve tried versions 1.0.0, 1.4, 2.0.0.

Asked By: Alexander

||

Answers:

Had this same error just now, found the solution. Make sure to install from:

pip install keycloak-client

Then import it doing:

from keycloak.keycloak_openid import KeycloakOpenID

# Configure client
keycloak_openid = KeycloakOpenID(
    server_url="https://localhost:8443/auth/",
    client_id="app_test",
    realm_name="test_realm",
    client_secret_key='SECRET_KEY'
)
Answered By: Jack Dragos

I am trying to connect keycloak with odoo. I don’t know where we can fetch the client_Secret data from keycloak.

Let me know, how to establish the connection with keycloak to odoo.

we need to discuss this points, what are the configuration do we need to implement keycloak.

Answered By: kirubanidhi
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.