Example usage for org.apache.shiro.web.util WebUtils _isSessionCreationEnabled

List of usage examples for org.apache.shiro.web.util WebUtils _isSessionCreationEnabled

Introduction

In this page you can find the example usage for org.apache.shiro.web.util WebUtils _isSessionCreationEnabled.

Prototype

public static boolean _isSessionCreationEnabled(ServletRequest request) 

Source Link

Document

Returns true if a session is allowed to be created for a subject-associated request, false otherwise.

Usage

From source file:br.com.criativasoft.opendevice.wsrest.RestWebSecurityManager.java

License:Open Source License

@Override
protected Subject createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing) {
    SubjectContext context = createSubjectContext();
    context.setAuthenticated(true);// w  ww  .ja va2  s .c om
    context.setAuthenticationToken(token);
    context.setAuthenticationInfo(info);
    if (existing != null) {
        // FIX Avoid session creation if previous Subject is disabled.
        // org.apache.shiro.subject.SubjectContext.isSessionCreationEnabled()
        if (existing instanceof WebDelegatingSubject) {
            context.setSessionCreationEnabled(WebUtils._isSessionCreationEnabled(this));
            context.setSecurityManager(((WebDelegatingSubject) existing).getSecurityManager());
        }
        context.setSubject(existing);
    }
    return createSubject(context);
}