Example usage for org.apache.shiro.authz ModularRealmAuthorizer ModularRealmAuthorizer

List of usage examples for org.apache.shiro.authz ModularRealmAuthorizer ModularRealmAuthorizer

Introduction

In this page you can find the example usage for org.apache.shiro.authz ModularRealmAuthorizer ModularRealmAuthorizer.

Prototype

public ModularRealmAuthorizer() 

Source Link

Document

Default no-argument constructor, does nothing.

Usage

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

License:Apache License

public ShiroSecurityManager() {
    super();//from   w  w  w  .  j  a  v a 2s .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 .java2  s . c o 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);

}