Java 类org.apache.shiro.authc.credential.AllowAllCredentialsMatcher 实例源码

项目:zkAdmin    文件:UserRealm.java   
@Override
    protected void assertCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) throws AuthenticationException {
        CredentialsMatcher cm = getCredentialsMatcher();
        if (cm != null) {
            if (!cm.doCredentialsMatch(token, info)) {
                //not successful - throw an exception to indicate this:
                String msg = "Submitted credentials for token [" + token + "] did not match the expected credentials.";
                throw new IncorrectCredentialsException(msg);
            }else {
                //记录登陆日志
/*                ShiroUser shiroUser = (ShiroUser)(info.getPrincipals().getPrimaryPrincipal());
                Log log = LogBuilder.OP_LOG.buildCommonLog("登陆", shiroUser.getClientIp(), shiroUser.getLoginName());
                logService.log(log);*/
            }
        } else {
            throw new AuthenticationException("A CredentialsMatcher must be configured in order to verify " +
                    "credentials during authentication.  If you do not wish for credentials to be examined, you " +
                    "can configure an " + AllowAllCredentialsMatcher.class.getName() + " instance.");
        }
    }
项目:mblog    文件:AccountRealm.java   
public AccountRealm() {
    super(new AllowAllCredentialsMatcher());
    setAuthenticationTokenClass(UsernamePasswordToken.class);

    //FIXME: 暂时禁用Cache
    setCachingEnabled(false);
}
项目:java-platform    文件:OauthUserRealm.java   
@Override
public void afterPropertiesSet() throws Exception {
    setCachingEnabled(true);
    setCacheManager(cacheManager);
    setAuthenticationCachingEnabled(true);
    setAuthenticationCacheName(CACHE_AUTHENTICATION);
    setAuthorizationCachingEnabled(true);
    setAuthorizationCacheName(CACHE_AUTHORIZATION);
    setAuthenticationTokenClass(OauthUserToken.class);
    setCredentialsMatcher(new AllowAllCredentialsMatcher());
}
项目:rabbitframework    文件:DefaultLdapRealm.java   
/**
 * Default no-argument constructor that defaults the internal {@link LdapContextFactory} instance to a
 * {@link JndiLdapContextFactory}.
 */
public DefaultLdapRealm() {
    //Credentials Matching is not necessary - the LDAP directory will do it automatically:
    setCredentialsMatcher(new AllowAllCredentialsMatcher());
    //Any Object principal and Object credentials may be passed to the LDAP provider, so accept any token:
    setAuthenticationTokenClass(AuthenticationToken.class);
    this.contextFactory = new JndiLdapContextFactory();
}
项目:rabbitframework    文件:AuthenticatingRealm.java   
/**
 * Asserts that the submitted {@code AuthenticationToken}'s credentials match the stored account
 * {@code AuthenticationInfo}'s credentials, and if not, throws an {@link AuthenticationException}.
 *
 * @param token the submitted authentication token
 * @param info  the AuthenticationInfo corresponding to the given {@code token}
 * @throws AuthenticationException if the token's credentials do not match the stored account credentials.
 */
protected void assertCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) throws AuthenticationException {
    CredentialsMatcher cm = getCredentialsMatcher();
    if (cm != null) {
        if (!cm.doCredentialsMatch(token, info)) {
            //not successful - throw an exception to indicate this:
            String msg = "Submitted credentials for token [" + token + "] did not match the expected credentials.";
            throw new IncorrectCredentialsException(msg);
        }
    } else {
        throw new AuthenticationException("A CredentialsMatcher must be configured in order to verify " +
                "credentials during authentication.  If you do not wish for credentials to be examined, you " +
                "can configure an " + AllowAllCredentialsMatcher.class.getName() + " instance.");
    }
}
项目:usergrid    文件:Realm.java   
public Realm( CacheManager cacheManager ) {
    super( cacheManager );
    setCredentialsMatcher( new AllowAllCredentialsMatcher() );
    setPermissionResolver(new CustomPermissionResolver());
    setCachingEnabled(true);
    setAuthenticationCachingEnabled(true);
}
项目:stateless-shiro    文件:BearerTokenAuthenticatingRealm.java   
public BearerTokenAuthenticatingRealm() {
    super(new AllowAllCredentialsMatcher());
    setAuthenticationTokenClass(BearerToken.class);
}
项目:agate    文件:AgateTokenRealm.java   
@PostConstruct
public void postConstruct() {
  setCacheManager(new MemoryConstrainedCacheManager());
  setCredentialsMatcher(new AllowAllCredentialsMatcher());
}
项目:usergrid    文件:Realm.java   
public Realm() {
    setCredentialsMatcher(new AllowAllCredentialsMatcher());
    setPermissionResolver(new CustomPermissionResolver());
}
项目:usergrid    文件:Realm.java   
public Realm( CredentialsMatcher matcher ) {
    super(new AllowAllCredentialsMatcher());
    setPermissionResolver(new CustomPermissionResolver());
}
项目:usergrid    文件:Realm.java   
public Realm( CacheManager cacheManager, CredentialsMatcher matcher ) {
    super(cacheManager, new AllowAllCredentialsMatcher());
    setPermissionResolver( new CustomPermissionResolver() );
    setCachingEnabled(true);
    setAuthenticationCachingEnabled(true);
}
项目:shiro-oltu    文件:OAuthAuthorizeRealm.java   
/**
 * Constructor with token URI and client id / secret, set authentication token
 * class to {@link OAuthClientToken}
 * 
 * @param tokenURI
 *          token URI
 * @param clientId
 *          client id
 * @param clientSecret
 *          client secret
 */
public OAuthAuthorizeRealm(String tokenURI, String clientId, String clientSecret) {
  super();
  this.tokenURI = tokenURI;
  this.clientId = clientId;
  this.clientSecret = clientSecret;
  setAuthenticationTokenClass(OAuthClientToken.class);
  setCredentialsMatcher(new AllowAllCredentialsMatcher());
}