[keycloak-user] Keycloak + JACC

Luca Stancapiano luca.stancapiano at vige.it
Sat Nov 17 06:35:29 EST 2018


I'm trying out the quickstart example at https://github.com/keycloak/keycloak-quickstarts. 

I use a keycloak 4.5.0.Final server distribution and a Wildfly 14.0.1 that opts the keycloak adapter and the web application. 

Once the client is installed on the server distribution and added the correct keycloak.json as required in the README on https://github.com/keycloak/keycloak-quickstarts/blob/latest/app-authz-jee-vanilla/README.md , the application works well. 

I would like to understand though if JACC can be used as a standard in web applications. For example, if I try to use the PolicyContext class inside a controller class method:

    public boolean isLoggedIn (HttpServletRequest req) throws PolicyContextException {
             System.out.println ("subject:" + PolicyContext.getContext ("javax.security.auth.Subject.container"));
             return getSession (req)! = null;
    }

I get null. Also trying to configure a JACC policy like:
/Subsystem=elytron/policy=JACC:add(JACC-policy={})
/Subsystem=undertow/application-security-domain=other:write-attribute(name=enable-JACC,value=true)

 I always get null. Is it possible to use JACC inside keycloak?



More information about the keycloak-user mailing list