當前位置: 首頁>>代碼示例>>Java>>正文


Java HashedCredentialsMatcher.setStoredCredentialsHexEncoded方法代碼示例

本文整理匯總了Java中org.apache.shiro.authc.credential.HashedCredentialsMatcher.setStoredCredentialsHexEncoded方法的典型用法代碼示例。如果您正苦於以下問題:Java HashedCredentialsMatcher.setStoredCredentialsHexEncoded方法的具體用法?Java HashedCredentialsMatcher.setStoredCredentialsHexEncoded怎麽用?Java HashedCredentialsMatcher.setStoredCredentialsHexEncoded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.shiro.authc.credential.HashedCredentialsMatcher的用法示例。


在下文中一共展示了HashedCredentialsMatcher.setStoredCredentialsHexEncoded方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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

示例3: 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

示例4: 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

示例5: UserRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
 * <p>Constructor for UserRealm.</p>
 */
public UserRealm() {
    final HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(Sha256Hash.ALGORITHM_NAME);
    credentialsMatcher.setHashIterations(1024);
    credentialsMatcher.setStoredCredentialsHexEncoded(false);
    this.setCredentialsMatcher(credentialsMatcher);
}
 
開發者ID:ExtaSoft,項目名稱:extacrm,代碼行數:10,代碼來源:UserRealm.java

示例6: PersistenceRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
 * Constructor adds EhCacheManager.
 */
public PersistenceRealm() {
    super(
        new EhCacheManager());

    // set hashed credentials matcher
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(HASH_ALGORITHM);
    credentialsMatcher.setHashIterations(HASH_ITERATIONS);
    credentialsMatcher.setStoredCredentialsHexEncoded(false);
    setCredentialsMatcher(credentialsMatcher);
}
 
開發者ID:panifex,項目名稱:panifex-platform,代碼行數:14,代碼來源:PersistenceRealm.java

示例7: afterPropertiesSet

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
@Override
public void afterPropertiesSet() throws Exception {
    HashedCredentialsMatcher cm = new HashedCredentialsMatcher(Sha256Hash.ALGORITHM_NAME);
    cm.setStoredCredentialsHexEncoded(false);
    cm.setHashIterations(Sha256.HASH_ITERATION);
    //cm.setHashSalted(true);
    this.setCredentialsMatcher(cm);
    // auto-create group "admins" and user "admin".
    adminsAutoCreate.run();
}
 
開發者ID:ageldama,項目名稱:glados-wiki,代碼行數:11,代碼來源:MyRealm.java

示例8: UserRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
 * Builds an instance of UserRealm and instantiates an HashedCredentialMatcher
 * 
 * @return an instance of UserRealm
 */
public UserRealm() {
	setName(USER_REALM_NAME);
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher("SHA-256");
	matcher.setStoredCredentialsHexEncoded(false);
	setCredentialsMatcher(matcher);
}
 
開發者ID:freedomotic,項目名稱:freedomotic,代碼行數:12,代碼來源:UserRealm.java


注:本文中的org.apache.shiro.authc.credential.HashedCredentialsMatcher.setStoredCredentialsHexEncoded方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。