javawildflywildfly-10requestcontext

WildFly 10 | Undertow | Create Wildfly LoginModule with access to RequestContext


i'm trying to create a login module for wildfly 10 with access to the request context. I must identify the request url. Also I have to analyse the GET parameters to check if a token is set.

How can I access to the request context and url informations in a "UsernamePasswordLoginModule" based class?

I have tried this

@Resource WebServiceContext wsctx;

but it doesn't work.


Solution

  • I have tried your suggestion. But it doesn't work. The web filter doesn't call.

    In the second step I have tried the following

    try {
            HttpServletRequest request = (HttpServletRequest) javax.security.jacc.PolicyContext
                    .getContext(HttpServletRequest.class.getName());
        } catch (PolicyContextException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    

    The result is that the method will probably terminate at this point (getContext) and the request is resubmitted. I don't know why.