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

Update user-storage-jpa to work with the new distribution #303

Closed
pedroigor opened this issue Mar 4, 2022 · 7 comments
Closed

Update user-storage-jpa to work with the new distribution #303

pedroigor opened this issue Mar 4, 2022 · 7 comments
Assignees
Milestone

Comments

@pedroigor
Copy link
Contributor

Describe the bug

Currently, it is not possible to run the user-storage-jpa quickstart due to keycloak/keycloak#10579.

We should update the quickstart to make it work with the new distribution while still keeping the module used to run the quickstart in the legacy distribution.

Version

17.0.0

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Anything else?

No response

@pedroigor pedroigor self-assigned this Mar 4, 2022
@pedroigor pedroigor modified the milestones: 17.0.0, 18.0.0 Mar 4, 2022
pedroigor added a commit to pedroigor/keycloak-quickstarts that referenced this issue Mar 4, 2022
pedroigor added a commit to pedroigor/keycloak-quickstarts that referenced this issue Mar 8, 2022
@ahus1
Copy link
Contributor

ahus1 commented Mar 8, 2022

There is now a PR for this: #302

@pedroigor
Copy link
Contributor Author

@ahus1 Thanks.

@pedroigor pedroigor reopened this Mar 8, 2022
pedroigor added a commit to pedroigor/keycloak-quickstarts that referenced this issue Mar 8, 2022
pedroigor added a commit to pedroigor/keycloak-quickstarts that referenced this issue Mar 8, 2022
pedroigor added a commit to pedroigor/keycloak-quickstarts that referenced this issue Mar 8, 2022
pedroigor added a commit to pedroigor/keycloak-quickstarts that referenced this issue Mar 8, 2022
pedroigor added a commit to pedroigor/keycloak-quickstarts that referenced this issue Mar 21, 2022
@marcelnem
Copy link

Will jpa user connector be supported only from keycloak 18? What should we do in the meantime if we want to update to keycloak 17 and we currently use User federation jpa on wildfly? Does it mean we have to wait till Keycloak 18 to switch to Quarkus?

Next to a new example, it would be also good to summarise steps to migrate existing providers. We spent a lot of time writing our DB user connector for wildfly, starting from a quarkus basic example might still be some work. For example it would be helpful to summarise changes such as that entity manager has to be initialized in a different way and other limitations of quarkus. In other words, the new example is useful for projects which start from scratch, but eventually all keycloak projects will have to migrate to quarkus, so the existing user storage providers in these organisations will have to be migrated to work with quarkus.

Maybe it is enough to look at the https://github.com/keycloak/keycloak-quickstarts/pull/302/files differences and apply the same differences to my provider, but this requires reverse engineering. A simple guide with the know-how from @pedroigor could save us time figuring out the same problems that he had to solve to migrate the user-storage-jpa example code.

The reverse engineering / comparing of files is not straightforward because the files are named differently and are moved to a different folder. I will have to do a diff from the previous UserAdapter to the new UserAdapter to see the actual changes I need to apply to my project.

Do these docs also need to be updated or are they independent of wildfly/quarkus or already updated for quarkus?
https://www.keycloak.org/docs/latest/server_development/index.html#_user-storage-spi

@pedroigor
Copy link
Contributor Author

@marcelnem You are right, the experience is not the best right now. We are trying to provide as much information as we can and possibly create some guides.

You should be able to use an additional datasouce/persistence unit starting from 17.0.1.

@stianst stianst modified the milestones: 18.0.0, 19.0.0 Apr 20, 2022
@DGuhr
Copy link
Contributor

DGuhr commented May 10, 2022

Closing here, as the new example is available under https://github.com/keycloak/keycloak-quickstarts/tree/main/user-storage-jpa - for a specific migration guide, I'd like to hear more specific problems first that we could address in that guide, after having that information let's create a new issue to create that guide.

@DGuhr DGuhr closed this as completed May 10, 2022
@marcelnem
Copy link

I was able to upgrade our user storage connector based on the example from @pedroigor pull request.

I did a diff between old code and the new example.
The little problems which I had to overcome were related to:
DB config (choosing SQL dialect) in persisence.xml
Changing how Entity Manager is initialized.
Removing JEE annotations
Updating deprecated interfaces to the new ones.

@nicolabeghin
Copy link

@pedroigor thanks for your work. I just opened issue #341 since server is not booting up with the out-of-the-box JAR from the updated user-storage-jpa. Really looking forward to any kind of input since blocked from updating my own user storage https://github.com/nicolabeghin/keycloak-multiple-ds-user-storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants