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

Issue using keycloak admin client #29958

Closed
heineson opened this issue Dec 19, 2022 · 5 comments · Fixed by #29772
Closed

Issue using keycloak admin client #29958

heineson opened this issue Dec 19, 2022 · 5 comments · Fixed by #29772
Labels
area/keycloak kind/bug Something isn't working
Milestone

Comments

@heineson
Copy link

Describe the bug

When using the Keycloak Admin Client by following the steps in https://quarkus.io/guides/security-keycloak-admin-client I get
ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (executor-thread-0) Request failed: javax.enterprise.context.ContextNotActiveException: RequestScoped context was not active when trying to obtain a bean instance for a client proxy of SYNTHETIC bean [class=org.keycloak.admin.client.Keycloak, id=1fb0e5144418a307281a16ae5d071d5d262b7891]
when using an @Injected client. Easy to workaround by creating the client manually as also shown in the guide.

So my question is probably: Is the guide not working (due to written too long ago perhaps?) or is there a bug somewhere in the quarkus libraries?

Expected behavior

That the code in https://quarkus.io/guides/security-keycloak-admin-client works when instructions are followed.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2+8-LTS)

GraalVM version (if different from Java)

n/a

Quarkus version or git rev

2.15.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Additional information

No response

@heineson heineson added the kind/bug Something isn't working label Dec 19, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 19, 2022

/cc @pedroigor(keycloak), @sberyozkin(keycloak)

@gsmet
Copy link
Member

gsmet commented Dec 19, 2022

Could you attach a zip with the version not working so that we can have a look? Thanks!

@heineson
Copy link
Author

Hello! Thanks for replying.
As you can imagine, of course this is because of an error on my side. So, if I forget to set the property quarkus.keycloak.admin-client.server-url in application.properties, then it will fail with ContextNotActiveException. If the property is present, it will not. However, consider this as an improvement request for a better error message in case someone makes similar mistakes!

@geoand
Copy link
Contributor

geoand commented Dec 20, 2022

This has already been fixed in #29772

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/keycloak kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants