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


Java LoginConfig类代码示例

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


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

示例1: postProcess

import io.undertow.servlet.api.LoginConfig; //导入依赖的package包/类
@Override
public void postProcess(BootContext context) {
  boolean statelessAuth = statelessAuth(context);
  DeploymentInfo deploymentInfo = context.deploymentInfo();

  deploymentInfo.addAuthenticationMechanism(RestAuthenticationMechanism.MECHANISM_NAME, (name, formParserFactory,
    properties) -> new RestAuthenticationMechanism(statelessAuth, context.getService(UserRepository.class)));

  LoginConfig loginConfig = new LoginConfig(RestAuthenticationMechanism.MECHANISM_NAME, "vas-db-realm");
  deploymentInfo.setLoginConfig(loginConfig);

  deploymentInfo.setIdentityManager(context.getService(IdentityManager.class));
  deploymentInfo.addSecurityConstraint(new SecurityConstraint().addRoleAllowed(User.ROLE).addWebResourceCollection(
    new WebResourceCollection().addUrlPattern("/*")));

  logoutServlet(context, deploymentInfo);
}
 
开发者ID:vvergnolle,项目名称:vas,代码行数:18,代码来源:AuthHttpHandlerPostProcessor.java

示例2: configureAuth

import io.undertow.servlet.api.LoginConfig; //导入依赖的package包/类
public void configureAuth(DeploymentInfo servletBuilder, ServerOptions serverOptions) {
    String realm = serverOptions.getServerName() + " Realm";
    log.debug("Enabling Basic Auth: " + realm);
    for(Entry<String,String> userNpass : serverOptions.getBasicAuth().entrySet()) {
        addUser(userNpass.getKey(), userNpass.getValue(), "role1");
        log.debug(String.format("User:%s password:%s",userNpass.getKey(),userNpass.getValue()));
    }
    LoginConfig loginConfig = new LoginConfig(realm);
    Map<String, String> props = new HashMap<>();
    props.put("charset", "ISO_8859_1");
    props.put("user-agent-charsets", "Chrome,UTF-8,OPR,UTF-8");
    loginConfig.addFirstAuthMethod(new AuthMethodConfig("BASIC", props));
    servletBuilder.setIdentityManager(this).setLoginConfig(loginConfig);
    // TODO: see if we can leverage this stuff
    //addConstraints(servletBuilder, serverOptions);

}
 
开发者ID:cfmlprojects,项目名称:runwar,代码行数:18,代码来源:SecurityManager.java

示例3: configureDeploymentSecurity

import io.undertow.servlet.api.LoginConfig; //导入依赖的package包/类
private void configureDeploymentSecurity(DeploymentInfo deploymentInfo) {
    deploymentInfo.setIdentityManager(identityManager);
    deploymentInfo.setLoginConfig(new LoginConfig(HttpServletRequest.BASIC_AUTH, "lightblueRealm"));
    deploymentInfo.addSecurityConstraint(new SecurityConstraint()
            .addWebResourceCollection(new WebResourceCollection().addUrlPattern("/*"))
            .addRoleAllowed(SECURITY_ROLE_AUTHENTICATED));
    deploymentInfo.addSecurityRole(SECURITY_ROLE_AUTHENTICATED);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rest,代码行数:9,代码来源:LightblueRestTestHarness.java

示例4: loginConfig

import io.undertow.servlet.api.LoginConfig; //导入依赖的package包/类
public static LoginConfig loginConfig(String realmName, String loginPage, String errorPage) {
    return new LoginConfig(realmName, loginPage, errorPage);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:Servlets.java


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