use of org.wildfly.security.auth.client.AuthenticationContext in project wildfly by wildfly.
the class SwitchIdentityTestCase method setupAuthenticationContext.
private AuthenticationContext setupAuthenticationContext(final String username) {
OptionMap.Builder builder = OptionMap.builder().set(Options.SASL_POLICY_NOANONYMOUS, true);
builder.set(Options.SASL_POLICY_NOPLAINTEXT, false);
builder.set(Options.SASL_DISALLOWED_MECHANISMS, Sequence.of("JBOSS-LOCAL-USER"));
final AuthenticationContext authenticationContext = AuthenticationContext.empty().with(MatchRule.ALL, AuthenticationConfiguration.EMPTY.useName(username == null ? "$local" : username).useRealm(null).allowSaslMechanisms("DIGEST-MD5").useMechanismProperties(getSaslProperties(builder.getMap())).useProvidersFromClassLoader(org.jboss.as.test.integration.ejb.container.interceptor.security.SwitchIdentityTestCase.class.getClassLoader()));
return authenticationContext;
}
Aggregations