Java Code Examples for javax.security.auth.message.config.AuthConfigFactory#getFactory()

The following examples show how to use javax.security.auth.message.config.AuthConfigFactory#getFactory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExampleApplicationTest.java    From crnk-example with Apache License 2.0 6 votes vote down vote up
@Before
public void setup() {
    RestAssured.port = port;

    docs = setupAsciidoc();

    client = new CrnkClient("http://localhost:" + port + "/api");
    client.addModule(docs);
    client.addModule(new PlainJsonFormatModule());
    client.findModules();

    // NPE fix
    if (AuthConfigFactory.getFactory() == null) {
        AuthConfigFactory.setFactory(new AuthConfigFactoryImpl());
    }
}
 
Example 2
Source File: AuthenticatorBase.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
private AuthConfigProvider findJaspicProvider() {
    AuthConfigFactory factory = AuthConfigFactory.getFactory();
    AuthConfigProvider provider = null;
    if (factory != null) {
        provider = factory.getConfigProvider("HttpServlet", jaspicAppContextID, this);
    }
    if (provider == null) {
        provider = NO_PROVIDER_AVAILABLE;
    }
    jaspicProvider = provider;
    return provider;
}
 
Example 3
Source File: BasicSpringBoot2Test.java    From crnk-framework with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
	TestModule.clear();

	// NPE fix
	if (AuthConfigFactory.getFactory() == null) {
		AuthConfigFactory.setFactory(new AuthConfigFactoryImpl());
	}
}
 
Example 4
Source File: BasicSpringBoot1Test.java    From crnk-framework with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
	TestModule.clear();

	// NPE fix
	if (AuthConfigFactory.getFactory() == null) {
		AuthConfigFactory.setFactory(new AuthConfigFactoryImpl());
	}
}
 
Example 5
Source File: SpringBootSimpleExampleApplicationTests.java    From crnk-framework with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    // NPE fix
    if (AuthConfigFactory.getFactory() == null) {
        AuthConfigFactory.setFactory(new AuthConfigFactoryImpl());
    }
}
 
Example 6
Source File: JaspiDefinition.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private static void removeRegistration(final OperationContext context) {
    final String registrationId = REGISTRATION_MAP.remove(context.getCurrentAddressValue());
    if (registrationId != null) {
        AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
        authConfigFactory.removeRegistration(registrationId);
    }
}
 
Example 7
Source File: ElytronDefinition.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private static AuthConfigFactory getAuthConfigFactory() {
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(ElytronDefinition.class.getClassLoader());
        return AuthConfigFactory.getFactory();
    } catch (Exception e) {
        ROOT_LOGGER.trace("Unable to load default AuthConfigFactory.", e);
        return null;
    } finally {
        Thread.currentThread().setContextClassLoader(classLoader);
    }
}