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

userID does not update even after passing ID in User struct #441

Open
shubhamUpadhyayInBlue opened this issue Aug 3, 2023 · 1 comment

Comments

@shubhamUpadhyayInBlue
Copy link

Describe the bug
The userID does not update even after passing ID in the user struct, here.

       user := gocloak.User{
		ID:            gocloak.StringP(data.MsgData.OrgID)

To Reproduce
Steps to reproduce the behavior:

  1. Run keycloak server using docker image - https://quay.io/repository/keycloak/keycloak?tab=tags&tag=latest
  2. Now use the gocloak library v13.7.0
  3. Send data to create new user and pass a custom userID to the ID field of User struct
  4. The user is created but not with the custom ID of the user but an auto-generated UUID.

Expected behavior

  1. Since ID is provided in the User struct it should update the user_id but it does not.

Screenshots
Screenshot 2023-08-03 at 12 28 59 PM
Screenshot 2023-08-03 at 12 30 23 PM

Desktop (please complete the following information):
N.A.

Smartphone (please complete the following information):
N.A.

Additional context
I also found an article that says that keycloak does not allow custom userid, but since it was being accepted in the user struct of this library I tried to update it but doesn't look like it works.

@Nerzal
Copy link
Owner

Nerzal commented Aug 4, 2023

The library is a wrapper around the keycloak API.
The models used in Gocloak match the models provided in the Keycloak API Documentation.

Some (lots) of these models hold more fields, than used/filled by the Keycloak API.
I guess it would be a good idea for the future to clean them up a bit, to match what they actually do.

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