Examples of AuthenticationSession


Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

    // ////////////////////////////
    public void append(final DebugBuilder debug) {
        debug.startSection("Scimpi Request");

        debug.appendTitle("User");
        final AuthenticationSession session = getSession();
        debug.appendln("Authentication Session", session);
        if (session != null) {
            debug.appendln("Name", session.getUserName());
            debug.appendln("Roles", session.getRoles());
        }

        debug.appendTitle("context");
        debug.appendln("Parent request path", requestedParentPath);
        debug.appendln("Requested file", requestedFile);
View Full Code Here

Examples of org.apache.isis.core.commons.authentication.AuthenticationSession

    @Override
    protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {

        // look for existing valid session
        final AuthenticationSession existingAuthSession = authenticationSessionStrategy.lookupValid(request, response);
        if (existingAuthSession != null) {
            redirectToStartPage(response, existingAuthSession.getUserName());
            return;
        }

        // prompt
        final String user = request.getParameter("username");
        final String password = request.getParameter("password");
        if (user == null && !getDeploymentType().isExploring()) {
            renderPrompt(response, "", "", null);
            return;
        }

        // authenticate; re-prompt if required
        final AuthenticationSession authSession = authenticate(user, password);
        if (authSession == null) {
            renderPrompt(response, user, password, "user/password invalid");
            return;
        }

        // authenticated
        authenticationSessionStrategy.bind(request, response, authSession);

        final Context context = new Context(getHtmlComponentFactory());
        context.setSession(authSession);
        authSession.setAttribute(HtmlServletConstants.AUTHENTICATION_SESSION_CONTEXT_KEY, context);

        LOG.info("created session");
        redirectToStartPage(response, user);
    }
View Full Code Here

Examples of org.apache.isis.metamodel.authentication.AuthenticationSession

            final long lastAccessedTime = session.getLastAccessedTime();
            str.append(new Date(lastAccessedTime));
            str.append(" \t");

            final AuthenticationSession nofSession = (AuthenticationSession) session.getAttribute("NOF_SESSION_ATTRIBUTE");
            if (nofSession != null) {
                str.append(nofSession.getUserName());
            }

            str.append("\n");
        }
        return str.toString();
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.