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


Java AuthConfigFactory类代码示例

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


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

示例1: registerServerAuthModule

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
/**
 * Registers a server auth module as the one and only module for the application corresponding to
 * the given servlet context.
 * <p/>
 * <p/>
 * This will override any other modules that have already been registered, either via proprietary
 * means or using the standard API.
 *
 * @param serverAuthModule the server auth module to be registered
 * @param servletContext   the context of the app for which the module is registered
 * @return A String identifier assigned by an underlying factory corresponding to an underlying factory-factory-factory registration
 */
public static String registerServerAuthModule(ServerAuthModule serverAuthModule, ServletContext servletContext) {

    // Register the factory-factory-factory for the SAM
    String registrationId = AuthConfigFactory.getFactory().registerConfigProvider(
            new DefaultAuthConfigProvider(serverAuthModule),
            "HttpServlet",
            getAppContextID(servletContext),
            "Default single SAM authentication config provider"
    );

    // Remember the registration ID returned by the factory, so we can unregister the JASPIC module when the web module
    // is undeployed. JASPIC being the low level API that it is won't do this automatically.
    servletContext.setAttribute(CONTEXT_REGISTRATION_ID, registrationId);

    return registrationId;
}
 
开发者ID:rdebusscher,项目名称:octopus-jsr375,代码行数:29,代码来源:Jaspic.java

示例2: setUp

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
   factory = AuthConfigFactory.getFactory();
   factory.registerConfigProvider(new JBossAuthConfigProvider(new HashMap(), null), layer, appId,
         "Test Config Provider");

   JBossSecurityContext jsc = new JBossSecurityContext("conf-jaspi-2");
   SecurityContextAssociation.setSecurityContext(jsc);

   XMLLoginConfigImpl xli = XMLLoginConfigImpl.getInstance();
   SecurityActions.setJAASConfiguration(xli);

   URL configURL = Thread.currentThread().getContextClassLoader().getResource(configFile);
   assertNotNull("Config URL", configURL);

   xli.setConfigURL(configURL);
   xli.loadConfig();
}
 
开发者ID:picketbox,项目名称:picketbox,代码行数:20,代码来源:JASPILoginModuleDelgateUnitTestCase.java

示例3: setUp

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void setUp() throws Exception
{
   factory = AuthConfigFactory.getFactory();
   factory.registerConfigProvider(new JBossAuthConfigProvider(new HashMap(), null), layer, appId,
         "Test Config Provider");

   SecurityContext jsc = new JBossSecurityContext("conf-jaspi");
   SecurityContextAssociation.setSecurityContext(jsc);

   XMLLoginConfigImpl xli = XMLLoginConfigImpl.getInstance();
   SecurityActions.setJAASConfiguration(xli);

   URL configURL = Thread.currentThread().getContextClassLoader().getResource(configFile);
   assertNotNull("Config URL", configURL);

   xli.setConfigURL(configURL);
   xli.loadConfig();
}
 
开发者ID:picketbox,项目名称:picketbox,代码行数:21,代码来源:JASPIWorkflowUnitTestCase.java

示例4: setUp

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void setUp() throws Exception
{
   factory = AuthConfigFactory.getFactory();
   factory.registerConfigProvider(new JBossAuthConfigProvider(new HashMap(), null), layer, appId,
         "Test Config Provider");

   jaspiManager = new JASPIServerAuthenticationManager("conf-jaspi", new JBossCallbackHandler());
   SecurityContext jsc = new JBossSecurityContext("conf-jaspi");
   SecurityContextAssociation.setSecurityContext(jsc);

   XMLLoginConfigImpl xli = XMLLoginConfigImpl.getInstance();
   SecurityActions.setJAASConfiguration(xli);

   URL configURL = Thread.currentThread().getContextClassLoader().getResource(configFile);
   assertNotNull("Config URL", configURL);

   xli.setConfigURL(configURL);
   xli.loadConfig();
}
 
开发者ID:picketbox,项目名称:picketbox,代码行数:21,代码来源:JASPIServerAuthenticationManagerUnitTestCase.java

示例5: setup

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
@Before
public void setup() {
	// NPE fix
	if (AuthConfigFactory.getFactory() == null) {
		AuthConfigFactory.setFactory(new AuthConfigFactoryImpl());
	}
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:8,代码来源:SpringBootSimpleExampleApplicationTests.java

示例6: deregisterServerAuthModule

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
/**
 * Deregisters the server auth module (and encompassing wrappers/factories) that was previously registered via a call
 * to registerServerAuthModule.
 *
 * @param servletContext the context of the app for which the module is deregistered
 */
public static void deregisterServerAuthModule(ServletContext servletContext) {
    String registrationId = (String) servletContext.getAttribute(CONTEXT_REGISTRATION_ID);
    if (!isEmpty(registrationId)) {
        AuthConfigFactory.getFactory().removeRegistration(registrationId);
    }
}
 
开发者ID:rdebusscher,项目名称:octopus-jsr375,代码行数:13,代码来源:Jaspic.java

示例7: YubiAuthConfigProvider

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
/**
 * Constructor with signature and implementation that's required by API.
 *
 * @param properties
 * @param factory
 */
public YubiAuthConfigProvider(Map<String, String> properties, AuthConfigFactory factory) {
  this.providerProperties = properties;
  if (factory != null) {
    factory.registerConfigProvider(this, null, null, "Auto registration");
  }
}
 
开发者ID:erik-wramner,项目名称:YubikeyAuth,代码行数:13,代码来源:YubiAuthConfigProvider.java

示例8: JBossWSAuthConfigProvider

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
public JBossWSAuthConfigProvider(Properties props, AuthConfigFactory factory)
{
   contextProperties = props;
   if (factory != null)
   {
      factory.registerConfigProvider(this, "soap", null, "JBossWS AuthConfigProvider");
   }

}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:10,代码来源:JBossWSAuthConfigProvider.java

示例9: contextInitialized

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
/**
 * <p>
 * Registers the configuration into the factory.
 * </p>
 * {@inheritDoc}
 */
@Override
public void contextInitialized(final ServletContextEvent sce) {

    final Map<String, String> options = new HashMap<>();
    registration = AuthConfigFactory.getFactory().registerConfigProvider(AuthModuleConfigProvider.class.getName(),
        options, "HttpServlet", null, null);

}
 
开发者ID:trajano,项目名称:jaspic-tester,代码行数:15,代码来源:Initializer.java

示例10: testInitializer

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
@Test
public void testInitializer() throws Exception {

    AuthConfigFactory.setFactory(mock(AuthConfigFactory.class));
    final Initializer i = new Initializer();
    i.contextInitialized(null);
    i.contextDestroyed(null);
}
 
开发者ID:trajano,项目名称:jaspic-tester,代码行数:9,代码来源:ApplicationManagedJaspicTest.java

示例11: contextInitialized

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
@Override
public void contextInitialized(final ServletContextEvent sce) {

    final Map<String, String> options = new HashMap<>();

    options.put(CLIENT_ID, config.getClientId());
    options.put(CLIENT_SECRET, config.getClientSecret());
    options.put(OpenIdConnectAuthModule.DISABLE_CERTIFICATE_CHECKS_KEY, String.valueOf(config.isCertificateCheckDisabled()));
    options.put(OpenIdConnectAuthModule.ISSUER_URI_KEY, config.getIssuerUri().toASCIIString());

    final String contextPath = sce.getServletContext()
        .getContextPath();
    final String rootPath = contextPath + "/";
    options.put("cookie_context", rootPath);
    options.put("scope", config.getScope());
    options.put("redirection_endpoint", contextPath + "/cb");
    options.put("logout_redirection_endpoint", contextPath + "/cblogout");
    options.put("token_uri", contextPath + "/token");
    options.put("userinfo_uri", contextPath + "/userinfo");
    // TODO make this dependent on openid configuration
    // options.put(OpenIdConnectAuthModule.LOGOUT_GOTO_URI_KEY, rootPath);
    options.put(OpenIdConnectAuthModule.LOGOUT_URI_KEY, contextPath + "/logout");

    registrationID = AuthConfigFactory.getFactory()
        .registerConfigProvider(new OpenIdConnectModuleConfigProvider(options, null), "HttpServlet", getAppContext(sce), null);
    Log.fine("registered", registrationID, options);
}
 
开发者ID:trajano,项目名称:openid-connect,代码行数:28,代码来源:Initializer.java

示例12: JBossAuthConfigProvider

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
/**
 * Create a new JBossAuthConfigProvider.
 * 
 * @param props Context Properties
 */
public JBossAuthConfigProvider(Map<String,Object> props, AuthConfigFactory factory)
{
   this.contextProperties = props;
   
   // if a factory has been supplied this provider needs to register itself.
   if (factory != null)
      factory.registerConfigProvider(this, null, null, "JBossAuthConfigProvider Self Registration");
}
 
开发者ID:picketbox,项目名称:picketbox,代码行数:14,代码来源:JBossAuthConfigProvider.java

示例13: setUp

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
@Override
public void setUp()
{
   factory = AuthConfigFactory.getFactory();
   factory.registerConfigProvider(new TestAuthConfigProvider(), "TEST", "APP", 
         "Test Config Provider");
}
 
开发者ID:picketbox,项目名称:picketbox,代码行数:8,代码来源:JASPIConfigUnitTestCase.java

示例14: TestAuthConfigProvider

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
/**
 * Constructor with signature and implementation that's required by API.
 * 
 * @param properties
 * @param factory
 */
public TestAuthConfigProvider(Map<String, String> properties, AuthConfigFactory factory) {
    this.providerProperties = properties;

    // API requires self registration if factory is provided. Not clear
    // where the "layer" (2nd parameter)
    // and especially "appContext" (3rd parameter) values have to come from
    // at this place.
    if (factory != null) {
        factory.registerConfigProvider(this, null, null, "Auto registration");
    }
}
 
开发者ID:ftomassetti,项目名称:JavaIncrementalParser,代码行数:18,代码来源:TestAuthConfigProvider.java

示例15: TestAuthConfigProvider

import javax.security.auth.message.config.AuthConfigFactory; //导入依赖的package包/类
/**
    * Constructor with signature and implementation that's required by API.
    * 
    * @param properties
    * @param factory
    */
public TestAuthConfigProvider(Map<String, String> properties, AuthConfigFactory factory) {
	this.providerProperties = properties;

	// API requires self registration if factory is provided. Not clear
	// where the "layer" (2nd parameter)
	// and especially "appContext" (3rd parameter) values have to come from
	// at this place.
	if (factory != null) {
		factory.registerConfigProvider(this, null, null,
				"Auto registration");
	}
}
 
开发者ID:arjantijms,项目名称:jaspic-capabilities-test,代码行数:19,代码来源:TestAuthConfigProvider.java


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