当前位置: 首页>>代码示例>>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;未经允许,请勿转载。