Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycloak_openid attribute not set in KeycloakOpenIDConnection #431

Closed
mklassen opened this issue Apr 12, 2023 · 1 comment · Fixed by #491
Closed

keycloak_openid attribute not set in KeycloakOpenIDConnection #431

mklassen opened this issue Apr 12, 2023 · 1 comment · Fixed by #491

Comments

@mklassen
Copy link
Contributor

If the token argument is passed during the initialization of a KeycloakOpenIDConnection instance, then the get_token() method is not called. However when the refresh_token() is subsequently called it attempts to access the self.keycloak_openid attribute which is set in get_token(). This results in the following error:

AttributeError: 'KeycloakOpenIDConnection' object has no attribute 'keycloak_openid'

The keycloak_openid should be an @property that creates the required KeycloakOpenID as required by either the get_token() or refresh_token() methods. It could also be an @cached_property to automatically handle the caching.

@mukarif
Copy link

mukarif commented Aug 10, 2023

same error my project.
Error: cannot import name 'KeycloakOpenIDConnection' from 'keycloak'

mklassen added a commit to mklassen/python-keycloak that referenced this issue Oct 19, 2023
Error occurs when token is set so refresh_token is called before call
to get_token.
mklassen added a commit to mklassen/python-keycloak that referenced this issue Oct 19, 2023
Error occurs when token is set so refresh_token is called before call
to get_token.
ryshoooo pushed a commit that referenced this issue Nov 13, 2023
* fix: remove internal use of deprecated methods

* fix: missing keycloak_openid during refresh (#431)

Error occurs when token is set so refresh_token is called before call
to get_token.

* feat: Add client update method

* fix: keycloak 22.0 dropped http challenge support

* fix: keycloak 22 changes default authenticator providers
NoDataIsAvailable pushed a commit to NoDataIsAvailable/python-keycloak-extended that referenced this issue Jan 8, 2024
…reirampj#491)

* fix: remove internal use of deprecated methods

* fix: missing keycloak_openid during refresh (marcospereirampj#431)

Error occurs when token is set so refresh_token is called before call
to get_token.

* feat: Add client update method

* fix: keycloak 22.0 dropped http challenge support

* fix: keycloak 22 changes default authenticator providers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants