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));
}
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);
}
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;
}
Aggregations