Example usage for org.apache.shiro.authc.pam ModularRealmAuthenticator ModularRealmAuthenticator

List of usage examples for org.apache.shiro.authc.pam ModularRealmAuthenticator ModularRealmAuthenticator

Introduction

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

Prototype

public ModularRealmAuthenticator() 

Source Link

Document

Default no-argument constructor which #setAuthenticationStrategy(AuthenticationStrategy) enables an org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy by default.

Usage

From source file:com.yea.shiro.mgt.ShiroSecurityManager.java

License:Apache License

public ShiroSecurityManager() {
    super();/* w  w  w  . ja  v  a2 s. co  m*/
    // authenticator
    ModularRealmAuthenticator authenticator = new ModularRealmAuthenticator();
    authenticator.setAuthenticationStrategy(new AtLeastOneSuccessfulStrategy());
    setAuthenticator(authenticator);

    // authorizer
    ModularRealmAuthorizer authorizer = new ModularRealmAuthorizer();
    authorizer.setPermissionResolver(new WildcardPermissionResolver());
    setAuthorizer(authorizer);

    // ?Matcher
    credentialsMatcher = new RetryLimitHashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName(EncrytPassword.PASSWORD_HASH);
    credentialsMatcher.setHashIterations(EncrytPassword.HASH_ITERATIONS);
    credentialsMatcher.setStoredCredentialsHexEncoded(true);

}

From source file:com.yea.shiro.web.mgt.WebSecurityManager.java

License:Apache License

public WebSecurityManager() {
    super();//from   w  ww  .j av  a  2  s. com
    // authenticator
    ModularRealmAuthenticator authenticator = new ModularRealmAuthenticator();
    authenticator.setAuthenticationStrategy(new AtLeastOneSuccessfulStrategy());
    setAuthenticator(authenticator);

    // authorizer
    ModularRealmAuthorizer authorizer = new ModularRealmAuthorizer();
    authorizer.setPermissionResolver(new WildcardPermissionResolver());
    setAuthorizer(authorizer);

    // ?Matcher
    credentialsMatcher = new RetryLimitHashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName(EncrytPassword.PASSWORD_HASH);
    credentialsMatcher.setHashIterations(EncrytPassword.HASH_ITERATIONS);
    credentialsMatcher.setStoredCredentialsHexEncoded(true);

}

From source file:org.killbill.billing.server.security.TenantFilter.java

License:Apache License

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

From source file:org.owasp.dependencytrack.config.SecurityConfiguration.java

License:Open Source License

@Bean
DefaultWebSecurityManager securityManager(DataSource dataSource) {
    DefaultWebSecurityManager defaultWebSecurityManager = new DefaultWebSecurityManager();
    Realm realm = jdbcRealm(dataSource);
    defaultWebSecurityManager.setRealm(realm);
    defaultWebSecurityManager.setCacheManager(cacheManager());
    ModularRealmAuthenticator authenticator = new ModularRealmAuthenticator();
    authenticator.setRealms(Arrays.asList(realm));
    authenticator.setAuthenticationStrategy(firstSuccessfulStrategy());
    defaultWebSecurityManager.setAuthenticator(authenticator);
    defaultWebSecurityManager.setAuthorizer(authorizer(dataSource, realm));
    return defaultWebSecurityManager;
}