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


Java PasswordEncoder類代碼示例

本文整理匯總了Java中org.pac4j.core.credentials.password.PasswordEncoder的典型用法代碼示例。如果您正苦於以下問題:Java PasswordEncoder類的具體用法?Java PasswordEncoder怎麽用?Java PasswordEncoder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PasswordEncoder類屬於org.pac4j.core.credentials.password包,在下文中一共展示了PasswordEncoder類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: MongoAuthenticationHandler

import org.pac4j.core.credentials.password.PasswordEncoder; //導入依賴的package包/類
public MongoAuthenticationHandler(final String name, final ServicesManager servicesManager, final PrincipalFactory principalFactory,
                                  final String collectionName, final String mongoHostUri, final String attributes, final String usernameAttribute,
                                  final String passwordAttribute, final PasswordEncoder mongoPasswordEncoder) {
    super(name, servicesManager, principalFactory, null);
    this.collectionName = collectionName;
    this.mongoHostUri = mongoHostUri;
    this.attributes = attributes;
    this.usernameAttribute = usernameAttribute;
    this.passwordAttribute = passwordAttribute;
    this.mongoPasswordEncoder = mongoPasswordEncoder;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:12,代碼來源:MongoAuthenticationHandler.java

示例2: start

import org.pac4j.core.credentials.password.PasswordEncoder; //導入依賴的package包/類
public void start(final int port) {
    MongodStarter starter = MongodStarter.getDefaultInstance();

    try {
        IMongodConfig mongodConfig = new MongodConfigBuilder()
                .version(Version.Main.PRODUCTION)
                .net(new Net(port, Network.localhostIsIPv6()))
                .build();

        mongodExecutable = starter.prepare(mongodConfig);
        mongodExecutable.start();

        // populate
        final MongoClient mongo = new MongoClient("localhost", port);
        final MongoDatabase db = mongo.getDatabase("users");
        db.createCollection("users");
        final MongoCollection<Document> collection = db.getCollection("users");
        final PasswordEncoder encoder = new BasicSaltedSha512PasswordEncoder(SALT);
        final String password = encoder.encode(PASSWORD);
        Map<String, Object> properties1 = new HashMap<>();
        properties1.put(USERNAME, GOOD_USERNAME);
        properties1.put(PASSWORD, password);
        properties1.put(FIRSTNAME, FIRSTNAME_VALUE);
        collection.insertOne(new Document(properties1));
        Map<String, Object> properties2 = new HashMap<>();
        properties2.put(USERNAME, MULTIPLE_USERNAME);
        properties2.put(PASSWORD, password);
        collection.insertOne(new Document(properties2));
        Map<String, Object> properties3 = new HashMap<>();
        properties3.put(USERNAME, MULTIPLE_USERNAME);
        properties3.put(PASSWORD, password);
        collection.insertOne(new Document(properties3));

    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:38,代碼來源:MongoServer.java

示例3: setup

import org.pac4j.core.credentials.password.PasswordEncoder; //導入依賴的package包/類
@Override
public void setup(Bootstrap<?> bootstrap) {
    ObjectMapper om = bootstrap.getObjectMapper();

    // for Config
    om.addMixIn(SessionStore.class, sessionStoreMixin());
    om.addMixIn(Authorizer.class, authorizerMixin());
    om.addMixIn(HttpActionAdapter.class, httpActionAdapterMixin());
    om.addMixIn(Matcher.class, matcherMixin());
    om.addMixIn(SecurityLogic.class, securityLogicMixin());
    om.addMixIn(CallbackLogic.class, callbackLogicMixin());
    om.addMixIn(LogoutLogic.class, logoutLogicMixin());

    // for Clients
    om.addMixIn(Client.class, clientMixin());
    om.addMixIn(BaseClient.class, baseClientMixin());

    // for Clients and Client subsclasses
    om.addMixIn(AjaxRequestResolver.class, ajaxRequestResolverMixin());
    om.addMixIn(UrlResolver.class, urlResolverMixin());
    om.addMixIn(AuthorizationGenerator.class,
            authorizationGeneratorMixin());

    // for Client/BaseClient
    om.addMixIn(Authenticator.class, authenticatorMixin());
    om.addMixIn(CredentialsExtractor.class, credentialExtractorMixin());
    om.addMixIn(ProfileCreator.class, profileCreatorMixin());

    // for IndirectClient
    om.addMixIn(RedirectActionBuilder.class, redirectActionBuilderMixin());
    om.addMixIn(LogoutActionBuilder.class, logoutActionBuilderMixin());
    
    // for some of the Authenticators
    om.addMixIn(PasswordEncoder.class, passwordEncoderMixin());
}
 
開發者ID:pac4j,項目名稱:dropwizard-pac4j,代碼行數:36,代碼來源:DefaultFeatureSupport.java

示例4: getPasswordEncoder

import org.pac4j.core.credentials.password.PasswordEncoder; //導入依賴的package包/類
public PasswordEncoder getPasswordEncoder() {
    return passwordEncoder;
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:4,代碼來源:AbstractUsernamePasswordAuthenticator.java

示例5: setPasswordEncoder

import org.pac4j.core.credentials.password.PasswordEncoder; //導入依賴的package包/類
public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
    this.passwordEncoder = passwordEncoder;
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:4,代碼來源:AbstractUsernamePasswordAuthenticator.java

示例6: MongoAuthenticator

import org.pac4j.core.credentials.password.PasswordEncoder; //導入依賴的package包/類
public MongoAuthenticator(final MongoClient mongoClient, final String attributes, final PasswordEncoder passwordEncoder) {
    this.mongoClient = mongoClient;
    this.attributes = attributes;
    setPasswordEncoder(passwordEncoder);
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:6,代碼來源:MongoAuthenticator.java

示例7: DbAuthenticator

import org.pac4j.core.credentials.password.PasswordEncoder; //導入依賴的package包/類
public DbAuthenticator(final DataSource dataSource, final String attributes, final PasswordEncoder passwordEncoder) {
    this.dataSource = dataSource;
    this.attributes = attributes;
    setPasswordEncoder(passwordEncoder);
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:6,代碼來源:DbAuthenticator.java


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