本文整理汇总了Java中org.apache.shiro.authc.credential.AllowAllCredentialsMatcher类的典型用法代码示例。如果您正苦于以下问题:Java AllowAllCredentialsMatcher类的具体用法?Java AllowAllCredentialsMatcher怎么用?Java AllowAllCredentialsMatcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AllowAllCredentialsMatcher类属于org.apache.shiro.authc.credential包,在下文中一共展示了AllowAllCredentialsMatcher类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: assertCredentialsMatch
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
@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.");
}
}
开发者ID:liaojiacan,项目名称:zkAdmin,代码行数:21,代码来源:UserRealm.java
示例2: AccountRealm
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
public AccountRealm() {
super(new AllowAllCredentialsMatcher());
setAuthenticationTokenClass(UsernamePasswordToken.class);
//FIXME: 暂时禁用Cache
setCachingEnabled(false);
}
开发者ID:ThomasYangZi,项目名称:mblog,代码行数:8,代码来源:AccountRealm.java
示例3: afterPropertiesSet
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
@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());
}
开发者ID:xiangxik,项目名称:java-platform,代码行数:12,代码来源:OauthUserRealm.java
示例4: DefaultLdapRealm
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
/**
* 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();
}
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:12,代码来源:DefaultLdapRealm.java
示例5: assertCredentialsMatch
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
/**
* 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.");
}
}
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:23,代码来源:AuthenticatingRealm.java
示例6: Realm
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
public Realm( CacheManager cacheManager ) {
super( cacheManager );
setCredentialsMatcher( new AllowAllCredentialsMatcher() );
setPermissionResolver(new CustomPermissionResolver());
setCachingEnabled(true);
setAuthenticationCachingEnabled(true);
}
开发者ID:apache,项目名称:usergrid,代码行数:8,代码来源:Realm.java
示例7: BearerTokenAuthenticatingRealm
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
public BearerTokenAuthenticatingRealm() {
super(new AllowAllCredentialsMatcher());
setAuthenticationTokenClass(BearerToken.class);
}
开发者ID:auslides,项目名称:stateless-shiro,代码行数:5,代码来源:BearerTokenAuthenticatingRealm.java
示例8: postConstruct
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
@PostConstruct
public void postConstruct() {
setCacheManager(new MemoryConstrainedCacheManager());
setCredentialsMatcher(new AllowAllCredentialsMatcher());
}
开发者ID:obiba,项目名称:agate,代码行数:6,代码来源:AgateTokenRealm.java
示例9: OAuthAuthorizeRealm
import org.apache.shiro.authc.credential.AllowAllCredentialsMatcher; //导入依赖的package包/类
/**
* 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());
}
开发者ID:hawkxu,项目名称:shiro-oltu,代码行数:20,代码来源:OAuthAuthorizeRealm.java
注:本文中的org.apache.shiro.authc.credential.AllowAllCredentialsMatcher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论