Example usage for org.apache.shiro.authc SimpleAccount SimpleAccount

List of usage examples for org.apache.shiro.authc SimpleAccount SimpleAccount

Introduction

In this page you can find the example usage for org.apache.shiro.authc SimpleAccount SimpleAccount.

Prototype

public SimpleAccount(PrincipalCollection principals, Object credentials) 

Source Link

Document

Constructs a SimpleAccount instance for the specified principals and credentials.

Usage

From source file:org.geppetto.frontend.controllers.GeppettoRealm.java

License:Open Source License

@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
    IGeppettoDataManager dataManager = DataManagerHelper.getDataManager();
    if (dataManager != null) {
        IUser user = dataManager.getUserByLogin((String) token.getPrincipal());
        SimplePrincipalCollection principals = new SimplePrincipalCollection(user, getName());
        SimpleAccount info = new SimpleAccount(principals, user.getPassword());
        return info;
    }/*from  www  .j  a  v a 2s.  co  m*/
    return null;
}

From source file:org.obiba.opal.core.runtime.security.CookieAuthenticatingRealm.java

License:Open Source License

@Override
protected AuthenticationInfo createtAuthenticationInfo(AuthenticationToken token,
        PrincipalCollection principals) {
    HttpCookieAuthenticationToken cookieToken = (HttpCookieAuthenticationToken) token;
    String urlHash = getUrlHash(cookieToken.getSessionId(), cookieToken.getUrl());
    return new SimpleAccount(principals, urlHash);
}

From source file:org.obiba.opal.core.runtime.security.HttpHeaderAuthenticatingRealm.java

License:Open Source License

@Override
protected AuthenticationInfo createtAuthenticationInfo(AuthenticationToken token,
        PrincipalCollection principals) {
    return new SimpleAccount(principals, null);
}

From source file:org.obiba.shiro.realm.CookieAuthenticatingRealm.java

License:Open Source License

@Override
protected AuthenticationInfo createAuthenticationInfo(AuthenticationToken token,
        PrincipalCollection principals) {
    HttpCookieAuthenticationToken cookieToken = (HttpCookieAuthenticationToken) token;
    String urlHash = getUrlHash(cookieToken.getSessionId(), cookieToken.getUrl());
    return new SimpleAccount(principals, urlHash);
}

From source file:org.obiba.shiro.realm.HttpHeaderAuthenticatingRealm.java

License:Open Source License

@Override
protected AuthenticationInfo createAuthenticationInfo(AuthenticationToken token,
        PrincipalCollection principals) {
    return new SimpleAccount(principals, null);
}