List of usage examples for org.apache.shiro.authz ModularRealmAuthorizer ModularRealmAuthorizer
public ModularRealmAuthorizer()
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); }