use of io.undertow.security.api.AuthenticationMechanism in project cxf by apache.
the class UndertowDigestAuthHandler method buildSecurityHandler.
private void buildSecurityHandler() {
HttpHandler handler = this.next;
handler = new AuthenticationCallHandler(handler);
handler = new AuthenticationConstraintHandler(handler);
final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new DigestAuthenticationMechanism("WSRealm", "WSDomain", "DIGEST", this.identityManager));
handler = new AuthenticationMechanismsHandler(handler, mechanisms);
this.securityHandler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
}
use of io.undertow.security.api.AuthenticationMechanism in project runwar by cfmlprojects.
the class SecurityManager method addSecurity.
public HttpHandler addSecurity(final HttpHandler toWrap, final Map<String, String> users, String realm) {
for (String userName : users.keySet()) {
addUser(userName, users.get(userName), "role1");
}
HttpHandler handler = toWrap;
handler = new AuthenticationCallHandler(handler);
handler = new AuthenticationConstraintHandler(handler);
final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism(realm));
handler = new AuthenticationMechanismsHandler(handler, mechanisms);
handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, this, handler);
return handler;
}
use of io.undertow.security.api.AuthenticationMechanism in project tutorials by eugenp.
the class SecureServer method addSecurity.
private static HttpHandler addSecurity(final HttpHandler toWrap, final IdentityManager identityManager) {
HttpHandler handler = toWrap;
handler = new AuthenticationCallHandler(handler);
handler = new AuthenticationConstraintHandler(handler);
final List<AuthenticationMechanism> mechanisms = Collections.singletonList(new BasicAuthenticationMechanism("Baeldung_Realm"));
handler = new AuthenticationMechanismsHandler(handler, mechanisms);
handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
return handler;
}
use of io.undertow.security.api.AuthenticationMechanism in project iri by iotaledger.
the class API method addSecurity.
private HttpHandler addSecurity(final HttpHandler toWrap) {
String credentials = instance.configuration.string(DefaultConfSettings.REMOTE_AUTH);
if (credentials == null || credentials.isEmpty()) {
return toWrap;
}
final Map<String, char[]> users = new HashMap<>(2);
users.put(credentials.split(":")[0], credentials.split(":")[1].toCharArray());
IdentityManager identityManager = new MapIdentityManager(users);
HttpHandler handler = toWrap;
handler = new AuthenticationCallHandler(handler);
handler = new AuthenticationConstraintHandler(handler);
final List<AuthenticationMechanism> mechanisms = Collections.singletonList(new BasicAuthenticationMechanism("Iota Realm"));
handler = new AuthenticationMechanismsHandler(handler, mechanisms);
handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
return handler;
}
use of io.undertow.security.api.AuthenticationMechanism in project undertow by undertow-io.
the class BasicAuthServer method addSecurity.
private static HttpHandler addSecurity(final HttpHandler toWrap, final IdentityManager identityManager) {
HttpHandler handler = toWrap;
handler = new AuthenticationCallHandler(handler);
handler = new AuthenticationConstraintHandler(handler);
final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("My Realm"));
handler = new AuthenticationMechanismsHandler(handler, mechanisms);
handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
return handler;
}
Aggregations