private static HttpHandler addSecurity(final HttpHandler toWrap, IdentityManager identityManager) { List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("Syncany")); HttpHandler handler = toWrap; handler = new AuthenticationCallHandler(handler); handler = new AuthenticationConstraintHandler(handler); handler = new AuthenticationMechanismsHandler(handler, mechanisms); handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler); return handler; }
private static HttpHandler addBasicSecurity(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("oauth2")); handler = new AuthenticationMechanismsHandler(handler, mechanisms); handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler); return handler; }
private HttpHandler addGetSecurity(final HttpHandler toWrap, final IdentityManager identityManager) { HttpHandler handler = toWrap; handler = new AuthenticationCallHandler(handler); handler = new AuthenticationConstraintHandler(handler); List<AuthenticationMechanism> mechanisms = new ArrayList<>(); // bypass the SPNEGO if service password is not even configured. if(spnegoServicePassword != null) { mechanisms.add(new LightGSSAPIAuthenticationMechanism(new SubjectFactory())); } mechanisms.add(new LightBasicAuthenticationMechanism("OAuth")); handler = new AuthenticationMechanismsHandler(handler, mechanisms); handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler); return handler; }
private HttpHandler addFormSecurity(final HttpHandler toWrap, final IdentityManager identityManager) { HttpHandler handler = toWrap; handler = new AuthenticationCallHandler(handler); handler = new AuthenticationConstraintHandler(handler); final List<AuthenticationMechanism> mechanisms = new ArrayList<>(); mechanisms.add(new CachedAuthenticatedSessionMechanism()); mechanisms.add(new FormAuthenticationMechanism("oauth2", "/login", "/error", "/oauth2/code")); handler = new AuthenticationMechanismsHandler(handler, mechanisms); handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler); handler = new SessionAttachmentHandler(handler, new InMemorySessionManager("oauth2"), new SessionCookieConfig()); return handler; }
private static HttpHandler addFormSecurity(final HttpHandler toWrap, final IdentityManager identityManager) { HttpHandler handler = toWrap; handler = new AuthenticationCallHandler(handler); handler = new AuthenticationConstraintHandler(handler); final List<AuthenticationMechanism> mechanisms = new ArrayList<>(); mechanisms.add(new CachedAuthenticatedSessionMechanism()); mechanisms.add(new FormAuthenticationMechanism("oauth2", "/login", "/error", "/oauth2/authorize")); handler = new AuthenticationMechanismsHandler(handler, mechanisms); handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler); handler = new SessionAttachmentHandler(handler, new InMemorySessionManager("oauth2"), new SessionCookieConfig()); return handler; } }
private HttpHandler createAuthenticationHandlersChain(HttpHandler next, AuthenticationConfiguration authConfig) { HttpHandler authenticationCallHandler = new AuthenticationCallHandler(next); HttpHandler constraintHandler = new AuthenticationPredicateAwareConstraintHandler( authenticationCallHandler, authConfig.getIsAuthenticationRequiredPredicate()); HttpHandler mechanismsHandler = new AuthenticationMechanismsHandler(constraintHandler, authConfig.getAuthMechanisms()); AuthenticationMode authenticationMode = AuthenticationMode.valueOf( configFactory.getStringProperty(Configs.FRONTEND_AUTHENTICATION_MODE).toUpperCase()); return new SecurityInitialHandler(authenticationMode, authConfig.getIdentityManager(), mechanismsHandler); }
mechanisms.add(new CachedAuthenticatedSessionMechanism()); mechanisms.add(new UndertowAuthenticationMechanism(deploymentContext, userSessionManagement, nodesRegistrationManagement, -1, null)); handler = new AuthenticationMechanismsHandler(handler, mechanisms); IdentityManager identityManager = new IdentityManager() { @Override
private void buildSecurityHandler() { HttpHandler handler = this.next; handler = new AuthenticationCallHandler(handler); handler = new AuthenticationConstraintHandler(handler); final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("My Realm")); handler = new AuthenticationMechanismsHandler(handler, mechanisms); this.securityHandler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler); }
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); }
current = new AuthenticationMechanismsHandler(current, authenticationMechanisms); } else { current = new AuthenticationMechanismsHandler(current, Collections.<AuthenticationMechanism>singletonList(deploymentInfo.getJaspiAuthenticationMechanism()));
current = new AuthenticationMechanismsHandler(current, authenticationMechanisms); } else { current = new AuthenticationMechanismsHandler(current, Collections.<AuthenticationMechanism>singletonList(deploymentInfo.getJaspiAuthenticationMechanism()));
current = new AuthenticationMechanismsHandler(current, authenticationMechanisms); } else { current = new AuthenticationMechanismsHandler(current, Collections.<AuthenticationMechanism>singletonList(deploymentInfo.getJaspiAuthenticationMechanism()));
handler = new AuthenticationMechanismsHandler(handler, undertowMechanisms); handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, idm, handler);
handler = new AuthenticationMechanismsHandler(handler, undertowMechanisms); handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, idm, handler);