[keycloak-user] cdi @inject KeycloakSecurityContext

Niko Köbler niko at n-k.de
Thu Dec 7 08:31:30 EST 2017


I wrote an AccessTokenProducer, which is @RequestScoped and injected it into an @ApplicationScoped Controller. It works.

https://github.com/dasniko/keycloak-javaee-demo/blob/master/src/main/java/dasniko/bookbox/AccessTokenProducer.java <https://github.com/dasniko/keycloak-javaee-demo/blob/master/src/main/java/dasniko/bookbox/AccessTokenProducer.java>
https://github.com/dasniko/keycloak-javaee-demo/blob/master/src/main/java/dasniko/bookbox/BookController.java <https://github.com/dasniko/keycloak-javaee-demo/blob/master/src/main/java/dasniko/bookbox/BookController.java>

- Niko



> Am 07.12.2017 um 11:51 schrieb Matthew Broadhead <matthew.broadhead at nbmlaw.co.uk>:
> 
> is there any mechanism to @Inject KeycloakSecurityContext into an 
> @ApplicationScoped CDI?  i am trying to use @Produces but it is quite tricky
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user



More information about the keycloak-user mailing list