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_open_id introspect function doesn't return correct user information after modification #476

Open
yang2lalang opened this issue Aug 9, 2023 · 1 comment

Comments

@yang2lalang
Copy link

yang2lalang commented Aug 9, 2023

Consider a change to user information

`
new_user_id = keycloak_admin.get_user_id(params["email"])
payload = {
"firstName": params["first_name"],
"lastName": params["last_name"],
"enabled": True,
}
keycloak_admin.update_user(new_user_id, payload)

`

After this change a call to introspect to obtain updated user info still contains old first_name and last_name

`
principal = keycloak_openid_client.introspect(access_token)
print("\n introspected principal (not updated: wrong)*************")
print(principal)
userinfo = keycloak_openid_client.userinfo(access_token)
print("\n introspected userinfo (updated correct) *************")
print(userinfo)

`

it seems the issue is from the keycloak server:

i'm having to do:

`
principal.update(userinfo)
print(principal)

`

@yang2lalang yang2lalang changed the title keycloak_open id introspect function doesn't return correct user information after modification keycloak_open_id introspect function doesn't return correct user information after modification Aug 9, 2023
@ryshoooo
Copy link
Collaborator

Isn't this expected? I'd expect that introspect just looks into the data in the generated token, it doesn't perform lookups in the keycloak database as userinfo does. I'm pretty sure however that if you refresh the access token after changing the user data, the introspect will give you the correct information.

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

No branches or pull requests

2 participants