當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。