public AuthenticatingRealm(CacheManager cacheManager, CredentialsMatcher matcher) { authenticationTokenClass = UsernamePasswordToken.class; //retain backwards compatibility for Shiro 1.1 and earlier. Setting to true by default will probably cause //unexpected results for existing applications: this.authenticationCachingEnabled = false; int instanceNumber = INSTANCE_COUNT.getAndIncrement(); this.authenticationCacheName = getClass().getName() + DEFAULT_AUTHORIZATION_CACHE_SUFFIX; if (instanceNumber > 0) { this.authenticationCacheName = this.authenticationCacheName + "." + instanceNumber; } if (cacheManager != null) { setCacheManager(cacheManager); } if (matcher != null) { setCredentialsMatcher(matcher); } }
public AuthenticatingRealm(CacheManager cacheManager, CredentialsMatcher matcher) { authenticationTokenClass = UsernamePasswordToken.class; //retain backwards compatibility for Shiro 1.1 and earlier. Setting to true by default will probably cause //unexpected results for existing applications: this.authenticationCachingEnabled = false; int instanceNumber = INSTANCE_COUNT.getAndIncrement(); this.authenticationCacheName = getClass().getName() + DEFAULT_AUTHORIZATION_CACHE_SUFFIX; if (instanceNumber > 0) { this.authenticationCacheName = this.authenticationCacheName + "." + instanceNumber; } if (cacheManager != null) { setCacheManager(cacheManager); } if (matcher != null) { setCredentialsMatcher(matcher); } }
public AuthenticatingRealm(CredentialsMatcher matcher) { setCredentialsMatcher(matcher); }
public AuthenticatingRealm(CacheManager cacheManager, CredentialsMatcher matcher) { setCacheManager(cacheManager); setCredentialsMatcher(matcher); }
@Bean(name = "mainRealm") @ConditionalOnMissingBean(name = "mainRealm") @DependsOn(value = {"lifecycleBeanPostProcessor", "credentialsMatcher"}) @ConditionalOnProperty(prefix = "shiro.realm.jdbc", name = "enabled", matchIfMissing = true) public Realm realm(CredentialsMatcher credentialsMatcher) { Class<?> realmClass = properties.getRealmClass(); Realm realm = (Realm) BeanUtils.instantiate(realmClass); if (realm instanceof AuthenticatingRealm) { ((AuthenticatingRealm) realm).setCredentialsMatcher(credentialsMatcher); } return realm; }
private void setReamCredentialsMatcher(RealmDefinition realmDefinition) { if (realmDefinition.getRealm().getTarget() instanceof AuthenticatingRealm) { ((AuthenticatingRealm) realmDefinition.getRealm().getTarget()).setCredentialsMatcher(realmDefinition.getRealm().getCredentialsMatcher().getTarget()); } }