public AuthenticatingRealm() { this(null, new SimpleCredentialsMatcher()); }
public AuthenticatingRealm(CacheManager cacheManager) { this(cacheManager, new SimpleCredentialsMatcher()); }
public AuthenticatingRealm() { this(null, new SimpleCredentialsMatcher()); }
public AuthenticatingRealm(CacheManager cacheManager) { this(cacheManager, new SimpleCredentialsMatcher()); }
public ApiKeyRealm(String name, CacheManager cacheManager, AuthIdentityReader<ApiKey> authIdentityReader, PermissionReader permissionReader, @Nullable String anonymousId) { super(null, AnonymousCredentialsMatcher.anonymousOrMatchUsing(new SimpleCredentialsMatcher())); _authIdentityReader = checkNotNull(authIdentityReader, "authIdentityReader"); _permissionReader = checkNotNull(permissionReader, "permissionReader"); _anonymousId = anonymousId; setName(checkNotNull(name, "name")); setAuthenticationTokenClass(ApiKeyAuthenticationToken.class); setPermissionResolver(permissionReader.getPermissionResolver()); setRolePermissionResolver(createRolePermissionResolver()); setCacheManager(prepareCacheManager(cacheManager)); setAuthenticationCachingEnabled(true); setAuthorizationCachingEnabled(true); // By default Shiro calls clearCache() for each user when they are logged out in order to prevent stale // credentials from being cached. However, if the cache manager implements InvalidatingCacheManager then it has // its own internal listeners that will invalidate the cache on any updates, making this behavior unnecessarily // expensive. _clearCaches = cacheManager != null && !(cacheManager instanceof InvalidatableCacheManager); _log.debug("Clearing of caches for realm {} is {}", name, _clearCaches ? "enabled" : "disabled"); }
matches = super.doCredentialsMatch(token, info); } else if (token.getLoginType().equals(MuitiLoginToken.TOKEN_MODE)) { SimpleCredentialsMatcher simpleMatcher = new SimpleCredentialsMatcher(); matches = simpleMatcher.doCredentialsMatch(token, info); } else {