Examples of AuthenticationSession


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

        }
        return instance.authenticationManager;
    }

    public static AuthenticationSession startRequest(final RequestContext context) {
        AuthenticationSession session = context.getSession();
        if (session == null) {
            session = new AnonymousSession();
            LOG.debug("start anonymous request: " + session);
        } else {
            LOG.debug("start request for: " + session.getUserName());
        }
        IsisContext.closeSession();
        IsisContext.openSession(session);
        return session;
    }
View Full Code Here

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

        IsisContext.openSession(session);
        return session;
    }

    public static AuthenticationSession authenticate(final AuthenticationRequestPassword passwordAuthenticationRequest) {
        final AuthenticationSession session = getAuthenticationManager().authenticate(passwordAuthenticationRequest);
        if (session != null) {
            LOG.info("log on user " + session.getUserName());
            IsisContext.closeSession();
            IsisContext.openSession(session);
        }
        return session;
    }
View Full Code Here

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

        if (username == null || password == null) {
            context.redirectTo("/");
            return;
        }
        AuthenticationSession session = null;
        if (username.length() == 0 || password.length() == 0) {
            isValid = false;
        } else {
            if (isDomainLogon) {
                final String objectId = context.getParameter(LOGON_OBJECT);
View Full Code Here

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

public class LogoutAction implements Action {

    public static void logoutUser(final RequestContext context) {
        if (context.isUserAuthenticated()) {
            final AuthenticationSession session = context.getSession();
            if (session != null) {
                IsisContext.getUpdateNotifier().clear();
                UserManager.logoffUser(session);
            }
            context.endHttpSession();
View Full Code Here

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

    private final Encoder encoder = new SimpleEncoder();
    private boolean showUnshownMessages;

    public void process(final RequestContext context, final String servletPath) {
        LOG.debug("processing request " + servletPath);
        final AuthenticationSession session = UserManager.startRequest(context);
        LOG.debug("exsiting session: " + session);
       
        String language = (String) context.getVariable("user-language");
        if (language != null) {
            Locale locale = Util.locale(language);
View Full Code Here

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

        };

        request.setBlockContent(containedBlock);
        request.processUtilCloseTag();

        final AuthenticationSession session = IsisContext.getAuthenticationSession();
        List<ObjectAssociation> viewFields = specification.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(session, object, where));
        viewFields = containedBlock.includedFields(viewFields);
        final InputField[] formFields = createFields(viewFields);

        initializeFields(context, object, formFields, entryState, !hideNonEditableFields);
View Full Code Here

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

    // TODO duplicated in ActionForm#initializeFields
    private void initializeFields(final RequestContext context, final ObjectAdapter object, final InputField[] formFields, final FormState entryState, final boolean includeUnusableFields) {
        for (final InputField formField : formFields) {
            final String fieldId = formField.getName();
            final ObjectAssociation field = object.getSpecification().getAssociation(fieldId);
            final AuthenticationSession session = IsisContext.getAuthenticationSession();
            final Consent usable = field.isUsable(session, object, where);
            final ObjectAdapter[] options = field.getChoices(object);
            FieldFactory.initializeField(context, object, field, options, field.isMandatory(), formField);

            final boolean isEditable = usable.isAllowed();
View Full Code Here

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

            // otherwise overloaded method may be incorrectly
            // selected.
            final ObjectAction action = MethodsUtils.findAction(object, methodName);
            entryState = validateParameters(context, action, object);

            AuthenticationSession session = context.getSession();
            if (session == null && action.isVisible(new AnonymousSession(), object, where).isVetoed()) {
                session = new AnonymousSession();
            }

            final Version originalVersion = context.getVersion(version);
View Full Code Here

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

        }
        final ObjectAssociation field = object.getSpecification().getAssociation(fieldName);
        if (field == null) {
            throw new ScimpiException("No field " + fieldName + " in " + object.getSpecification().getFullIdentifier());
        }
        final AuthenticationSession session = IsisContext.getAuthenticationSession();
        if (field.isVisible(session, object, where).isVetoed()) {
            throw new ForbiddenException(field, ForbiddenException.VISIBLE);
        }

        String pattern = request.getOptionalProperty("decimal-format");
View Full Code Here

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

    private static final Logger LOG = LoggerFactory.getLogger(LogAction.class);

    @Override
    public void process(final RequestContext context) throws IOException {

        final AuthenticationSession session = context.getSession();
        if (session == null) {
            throw new NotLoggedInException();
        }

        final String levelName = (String) context.getVariable("level");
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.