Package io.undertow.server.session

Examples of io.undertow.server.session.Session.removeAttribute()


                if (System.getSecurityManager() == null) {
                    session = httpSession.getSession();
                } else {
                    session = AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(httpSession));
                }
                session.removeAttribute(ATTRIBUTE_NAME);
            }
        }

    }
View Full Code Here


            if(request != null) {
                if(request.requestUri.equals(exchange.getRequestURI()) && exchange.isRequestComplete()) {
                    UndertowLogger.REQUEST_LOGGER.debugf("restoring request body for request to %s", request.requestUri);
                    exchange.setRequestMethod(request.method);
                    Connectors.ungetRequestBytes(exchange, new ImmediatePooled<ByteBuffer>(ByteBuffer.wrap(request.data, 0, request.dataLength)));
                    underlyingSession.removeAttribute(SESSION_KEY);
                    //clear the existing header map of everything except the connection header
                    //TODO: are there other headers we should preserve?
                    Iterator<HeaderValues> headerIterator = exchange.getRequestHeaders().iterator();
                    while (headerIterator.hasNext()) {
                        HeaderValues header = headerIterator.next();
View Full Code Here

            securityContext.authenticationComplete(account, "KEYCLOAK", false);
            ((UndertowRequestAuthenticator)authenticator).propagateKeycloakContext(account);
            return true;
        } else {
            log.debug("Account was not active, returning false");
            session.removeAttribute(KeycloakUndertowAccount.class.getName());
            session.invalidate(exchange);
            return false;
        }
    }
View Full Code Here

    public void logout() {
        Session session = Sessions.getSession(exchange);
        if (session == null) return;
        KeycloakUndertowAccount account = (KeycloakUndertowAccount)session.getAttribute(KeycloakUndertowAccount.class.getName());
        if (account == null) return;
        session.removeAttribute(KeycloakUndertowAccount.class.getName());
    }

    @Override
    public void refreshCallback(RefreshableKeycloakSecurityContext securityContext) {
        // no-op
View Full Code Here

    }

    protected void handleRedirectBack(final HttpServerExchange exchange) {
        final Session session = Sessions.getSession(exchange);
        if (session != null) {
            final String location = (String) session.removeAttribute(LOCATION_ATTRIBUTE);
            if(location != null) {
                exchange.addDefaultResponseListener(new DefaultResponseListener() {
                    @Override
                    public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                        FormAuthenticationMechanism.sendRedirect(exchange, location);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.