Example usage for org.apache.shiro.subject SubjectContext isAuthenticated

List of usage examples for org.apache.shiro.subject SubjectContext isAuthenticated

Introduction

In this page you can find the example usage for org.apache.shiro.subject SubjectContext isAuthenticated.

Prototype

boolean isAuthenticated();

Source Link

Document

Returns true if the constructed Subject should be considered authenticated, false otherwise.

Usage

From source file:io.buji.pac4j.ClientSubjectFactory.java

License:Apache License

@Override
public Subject createSubject(SubjectContext context) {

    boolean authenticated = context.isAuthenticated();

    if (authenticated) {

        AuthenticationToken token = context.getAuthenticationToken();

        if (token != null && token instanceof ClientToken) {
            ClientToken clientToken = (ClientToken) token;
            if (clientToken.isRememberMe()) {
                context.setAuthenticated(false);
            }//ww  w  .  j ava2 s  .c  om
        }
    }

    return super.createSubject(context);
}

From source file:io.buji.pac4j.subject.Pac4jSubjectFactory.java

License:Apache License

@Override
public Subject createSubject(SubjectContext context) {

    boolean authenticated = context.isAuthenticated();

    if (authenticated) {

        AuthenticationToken token = context.getAuthenticationToken();

        if (token != null && token instanceof Pac4jToken) {
            final Pac4jToken clientToken = (Pac4jToken) token;
            if (clientToken.isRememberMe()) {
                context.setAuthenticated(false);
            }/*from w  w  w  . j av a 2 s .  c om*/
        }
    }

    return super.createSubject(context);
}