当前位置: 首页>>代码示例>>Java>>正文


Java HashedCredentialsMatcher类代码示例

本文整理汇总了Java中org.apache.shiro.authc.credential.HashedCredentialsMatcher的典型用法代码示例。如果您正苦于以下问题:Java HashedCredentialsMatcher类的具体用法?Java HashedCredentialsMatcher怎么用?Java HashedCredentialsMatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HashedCredentialsMatcher类属于org.apache.shiro.authc.credential包,在下文中一共展示了HashedCredentialsMatcher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ClothoRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
@Inject
public ClothoRealm(CredentialStore store, RolePermissionResolver roleResolver) {
    super();
    
    //XXX: up number of iterations
    HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(Sha256Hash.ALGORITHM_NAME);
    matcher.setStoredCredentialsHexEncoded(false);
    
    this.store = store;
    setAuthenticationTokenClass(UsernamePasswordToken.class);
    setCredentialsMatcher(matcher);

    setRolePermissionResolver(roleResolver);

    setUpRealm();
}
 
开发者ID:CIDARLAB,项目名称:clotho3crud,代码行数:17,代码来源:ClothoRealm.java

示例2: initCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
@PostConstruct
public void initCredentialsMatcher() {
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(
			Random.SHA1);
	matcher.setHashIterations(Random.ITERATION);
	setCredentialsMatcher(matcher);
}
 
开发者ID:jiangzongyao,项目名称:kettle_support_kettle8.0,代码行数:8,代码来源:Authorizing2Realm.java

示例3: myAuthRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * realm
 * 
 * @return
 */
@Bean(name = "shiroRealm")
public ShiroRealm myAuthRealm(
        @Qualifier("hashedCredentialsMatcher") HashedCredentialsMatcher matcher
       ) {
	ShiroRealm shiroRealm = new ShiroRealm();
    // 设置密码凭证匹配器
	shiroRealm.setCredentialsMatcher(matcher); // myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher());

    return shiroRealm;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:16,代码来源:ShiroConfig.java

示例4: setCredentialMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * 用户的登录的明文密码,先经过md5加密再和数据库比对
 */
@PostConstruct
public void setCredentialMatcher() {
	HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
	credentialsMatcher.setHashAlgorithmName("MD5");
	credentialsMatcher.setHashIterations(1024);
	setCredentialsMatcher(credentialsMatcher);
}
 
开发者ID:MarchMachao,项目名称:ZHFS-WEB,代码行数:11,代码来源:MyRealm.java

示例5: hashedCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * HashCredentialsMatcher,对密码进行编码
 */
@Bean(name = "hashCredentialsMatcher")
public HashedCredentialsMatcher hashedCredentialsMatcher(){
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName("MD5");
    credentialsMatcher.setHashIterations(2); //散列两次
    credentialsMatcher.setStoredCredentialsHexEncoded(true);
    return credentialsMatcher;
}
 
开发者ID:ZhuXS,项目名称:Spring-Shiro-Spark,代码行数:12,代码来源:ShiroConfig.java

示例6: initCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * 设定密码校验的Hash算法与迭代次数
 */
@PostConstruct
public void initCredentialsMatcher() {
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(MD5Util.HASH_ALGORITHM);
	matcher.setHashIterations(MD5Util.HASH_INTERATIONS);
	setCredentialsMatcher(matcher);
}
 
开发者ID:egojit8,项目名称:easyweb,代码行数:10,代码来源:SystemAuthorizingRealm.java

示例7: initCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * 设定密码校验的Hash算法与迭代次数
 */
@PostConstruct
public void initCredentialsMatcher() {
    HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(SystemService.HASH_ALGORITHM);
    matcher.setHashIterations(SystemService.HASH_INTERATIONS);
    setCredentialsMatcher(matcher);
}
 
开发者ID:ansafari,项目名称:melon,代码行数:10,代码来源:SystemAuthorizingRealm.java

示例8: initCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * 设定Password校验的Hash算法与迭代次数.
 */
@PostConstruct
public void initCredentialsMatcher() {
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(AccountService.HASH_ALGORITHM);
	matcher.setHashIterations(AccountService.HASH_INTERATIONS);

	setCredentialsMatcher(matcher);
}
 
开发者ID:XiaoChenYung,项目名称:YCBugsManager,代码行数:11,代码来源:ShiroDbRealm.java

示例9: initCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * 设定密码校验的Hash算法与迭代次数
 */
@PostConstruct
public void initCredentialsMatcher() {
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(SystemService.HASH_ALGORITHM);
	matcher.setHashIterations(SystemService.HASH_INTERATIONS);
	setCredentialsMatcher(matcher);
}
 
开发者ID:whatlookingfor,项目名称:spring-boot-sample,代码行数:10,代码来源:SystemAuthorizingRealm.java

示例10: buildRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
public AuthorizingRealm buildRealm(UserService userService, ConfigurationService configService) {
    JdbcSaltedRealm realm = new JdbcSaltedRealm(userService, configService);
    HashedCredentialsMatcher matcher = new HashedCredentialsMatcher("SHA-256");
    matcher.setHashIterations(1024);
    matcher.setStoredCredentialsHexEncoded(false);
    realm.setCredentialsMatcher(matcher);

    return realm;
}
 
开发者ID:Zabrimus,项目名称:vdr-jonglisto,代码行数:10,代码来源:AppModule.java

示例11: createEnvironment

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
@Override
protected WebEnvironment createEnvironment(ServletContext sc) {
    WebEnvironment webEnvironment = super.createEnvironment(sc);
    RealmSecurityManager rsm = (RealmSecurityManager) webEnvironment.getSecurityManager();
    HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher(HASHING_ALGORITHM);
    hashedCredentialsMatcher.setStoredCredentialsHexEncoded(true);
    jpaRealm.setCredentialsMatcher(hashedCredentialsMatcher);      
    Collection<Realm> realms = rsm.getRealms();
    realms.add(jpaRealm);
    rsm.setRealms(realms);
    ((DefaultWebEnvironment) webEnvironment).setSecurityManager(rsm);
    return webEnvironment;
}
 
开发者ID:felixhusse,项目名称:bookery,代码行数:14,代码来源:CDIAwareShiroEnvironmentLoader.java

示例12: initCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * 设定Password校验的Hash算法与迭代次数.
 */
@PostConstruct
public void initCredentialsMatcher() {
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(
			UserConstant.HASH_ALGORITHM);
	matcher.setHashIterations(UserConstant.HASH_INTERATIONS);
	setCredentialsMatcher(matcher);
}
 
开发者ID:wu560130911,项目名称:MultimediaDesktop,代码行数:11,代码来源:UserRealm.java

示例13: jdbcRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
@Bean(name = "jdbcRealm")
@DependsOn("lifecycleBeanPostProcessor")
public JdbcRealm jdbcRealm() {
    JdbcRealm realm = new JdbcRealm();
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName(Sha256Hash.ALGORITHM_NAME);
    realm.setCredentialsMatcher(credentialsMatcher);
    realm.setDataSource(dataSource);
    realm.init();
    return realm;
}
 
开发者ID:mraible,项目名称:java-webapp-security-examples,代码行数:12,代码来源:WebSecurityConfig.java

示例14: AppDbRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
public AppDbRealm() {
    HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(EncodeKit.HASH_ALGORITHM);
    matcher.setHashIterations(EncodeKit.HASH_INTERATIONS);

    setCredentialsMatcher(matcher);

    setName("goja_app_realm");
}
 
开发者ID:GojaFramework,项目名称:goja,代码行数:9,代码来源:AppDbRealm.java

示例15: initCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //导入依赖的package包/类
/**
 * 构造器,设定Password校验的Hash算法与迭代次数.
 */
@PostConstruct
public void initCredentialsMatcher() {
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(
			Digests.SHA512_ALGORITHM);
	matcher.setHashIterations(Digests.HASH_INTERATIONS);
	setCredentialsMatcher(matcher);
}
 
开发者ID:wanghuizi,项目名称:fengduo,代码行数:11,代码来源:ShiroDbRealm.java


注:本文中的org.apache.shiro.authc.credential.HashedCredentialsMatcher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。