Search in sources :

Example 6 with SecurityManager

use of org.apache.shiro.mgt.SecurityManager in project neo4j by neo4j.

the class ShiroSubjectFactory method createSubject.

@Override
public Subject createSubject(SubjectContext context) {
    SecurityManager securityManager = context.resolveSecurityManager();
    Session session = context.resolveSession();
    boolean sessionCreationEnabled = context.isSessionCreationEnabled();
    PrincipalCollection principals = context.resolvePrincipals();
    boolean authenticated = context.resolveAuthenticated();
    String host = context.resolveHost();
    ShiroAuthenticationInfo authcInfo = (ShiroAuthenticationInfo) context.getAuthenticationInfo();
    return new ShiroSubject(principals, authenticated, host, session, sessionCreationEnabled, securityManager, authcInfo.getAuthenticationResult());
}
Also used : SecurityManager(org.apache.shiro.mgt.SecurityManager) PrincipalCollection(org.apache.shiro.subject.PrincipalCollection) Session(org.apache.shiro.session.Session)

Example 7 with SecurityManager

use of org.apache.shiro.mgt.SecurityManager in project qi4j-sdk by Qi4j.

the class StandaloneShiroTest method documentationSupport_before.

public void documentationSupport_before() {
    // START SNIPPET: before
    IniSecurityManagerFactory factory = new IniSecurityManagerFactory("classpath:standalone-shiro.ini");
    SecurityManager securityManager = factory.getInstance();
    SecurityUtils.setSecurityManager(securityManager);
// END SNIPPET: before
}
Also used : IniSecurityManagerFactory(org.apache.shiro.config.IniSecurityManagerFactory) SecurityManager(org.apache.shiro.mgt.SecurityManager)

Aggregations

SecurityManager (org.apache.shiro.mgt.SecurityManager)7 IniSecurityManagerFactory (org.apache.shiro.config.IniSecurityManagerFactory)6 Ini (org.apache.shiro.config.Ini)2 GeneralSecurityException (java.security.GeneralSecurityException)1 AccountLockedException (javax.security.auth.login.AccountLockedException)1 AccountNotFoundException (javax.security.auth.login.AccountNotFoundException)1 CredentialExpiredException (javax.security.auth.login.CredentialExpiredException)1 FailedLoginException (javax.security.auth.login.FailedLoginException)1 AuthenticationException (org.apache.shiro.authc.AuthenticationException)1 DisabledAccountException (org.apache.shiro.authc.DisabledAccountException)1 ExcessiveAttemptsException (org.apache.shiro.authc.ExcessiveAttemptsException)1 ExpiredCredentialsException (org.apache.shiro.authc.ExpiredCredentialsException)1 IncorrectCredentialsException (org.apache.shiro.authc.IncorrectCredentialsException)1 LockedAccountException (org.apache.shiro.authc.LockedAccountException)1 UnknownAccountException (org.apache.shiro.authc.UnknownAccountException)1 ConfigurationException (org.apache.shiro.config.ConfigurationException)1 DefaultSecurityManager (org.apache.shiro.mgt.DefaultSecurityManager)1 Realm (org.apache.shiro.realm.Realm)1 IniRealm (org.apache.shiro.realm.text.IniRealm)1 Session (org.apache.shiro.session.Session)1