/** * @see io.undertow.security.handlers.AbstractSecurityContextAssociationHandler#createSecurityContext() */ @Override public SecurityContext createSecurityContext(final HttpServerExchange exchange) { return contextFactory.createSecurityContext(exchange, authenticationMode, identityManager, programaticMechName); }
/** * @see io.undertow.security.handlers.AbstractSecurityContextAssociationHandler#createSecurityContext() */ @Override public SecurityContext createSecurityContext(final HttpServerExchange exchange) { return contextFactory.createSecurityContext(exchange, authenticationMode, identityManager, programaticMechName); }
/** * @see io.undertow.security.handlers.AbstractSecurityContextAssociationHandler#createSecurityContext() */ @Override public SecurityContext createSecurityContext(final HttpServerExchange exchange) { return contextFactory.createSecurityContext(exchange, authenticationMode, identityManager, programaticMechName); }
@Override public void handleRequest(HttpServerExchange exchange, RequestContext context) throws Exception { SecurityContext newContext = this.contextFactory .createSecurityContext(exchange, authenticationMode, identityManager, programaticMechName); setSecurityContext(exchange, newContext); next(exchange, context); }
/** * Populate the security context with the authenticated user profiles. * * @param context the web context * @param profiles the linked hashmap of profiles */ public static void populateContext(final UndertowWebContext context, final LinkedHashMap<String, CommonProfile> profiles) { if (profiles != null && profiles.size() > 0) { final HttpServerExchange exchange = context.getExchange(); SecurityContext securityContext = exchange.getSecurityContext(); if (securityContext == null) { securityContext = SecurityContextFactoryImpl.INSTANCE.createSecurityContext(exchange, AuthenticationMode.PRO_ACTIVE, null, null); } securityContext.authenticationComplete(new Pac4jAccount(profiles), "PAC4J_ACCOUNT", false); exchange.setSecurityContext(securityContext); } } }