Search in sources :

Example 1 with ModularRealmAuthenticator

use of org.apache.shiro.authc.pam.ModularRealmAuthenticator in project killbill by killbill.

the class TenantFilter method init.

@Override
public void init(final FilterConfig filterConfig) throws ServletException {
    // We use Shiro to verify the api credentials - but the Shiro Subject is only used for RBAC
    modularRealmAuthenticator = new ModularRealmAuthenticator();
    modularRealmAuthenticator.setRealms(ImmutableList.<Realm>of(killbillJdbcTenantRealm));
}
Also used : ModularRealmAuthenticator(org.apache.shiro.authc.pam.ModularRealmAuthenticator)

Example 2 with ModularRealmAuthenticator

use of org.apache.shiro.authc.pam.ModularRealmAuthenticator in project graylog2-server by Graylog2.

the class SessionCreatorTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    SimpleAccountRealm realm = new SimpleAccountRealm();
    realm.addAccount(validToken.getUsername(), String.valueOf(validToken.getPassword()));
    // Set up a security manager like in DefaultSecurityManagerProvider
    securityManager = new DefaultSecurityManager(realm);
    FirstSuccessfulStrategy strategy = new ThrowingFirstSuccessfulStrategy();
    strategy.setStopAfterFirstSuccess(true);
    ((ModularRealmAuthenticator) securityManager.getAuthenticator()).setAuthenticationStrategy(strategy);
    SecurityUtils.setSecurityManager(securityManager);
}
Also used : ModularRealmAuthenticator(org.apache.shiro.authc.pam.ModularRealmAuthenticator) SimpleAccountRealm(org.apache.shiro.realm.SimpleAccountRealm) DefaultSecurityManager(org.apache.shiro.mgt.DefaultSecurityManager) FirstSuccessfulStrategy(org.apache.shiro.authc.pam.FirstSuccessfulStrategy) Before(org.junit.Before)

Example 3 with ModularRealmAuthenticator

use of org.apache.shiro.authc.pam.ModularRealmAuthenticator in project shiro by apache.

the class AbstractShiroConfiguration method authenticator.

protected Authenticator authenticator() {
    ModularRealmAuthenticator authenticator = new ModularRealmAuthenticator();
    authenticator.setAuthenticationStrategy(authenticationStrategy());
    return authenticator;
}
Also used : ModularRealmAuthenticator(org.apache.shiro.authc.pam.ModularRealmAuthenticator)

Aggregations

ModularRealmAuthenticator (org.apache.shiro.authc.pam.ModularRealmAuthenticator)3 FirstSuccessfulStrategy (org.apache.shiro.authc.pam.FirstSuccessfulStrategy)1 DefaultSecurityManager (org.apache.shiro.mgt.DefaultSecurityManager)1 SimpleAccountRealm (org.apache.shiro.realm.SimpleAccountRealm)1 Before (org.junit.Before)1