Examples of SimpleSession


Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

        final List<String> roles = rolesFrom(httpServletRequest);

        if (Strings.isNullOrEmpty(user)) {
            return null;
        }
        return new SimpleSession(user, roles);
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

        List<String> roles = getRoles(token);
        // copy over any roles passed in
        // (this is used by the Wicket viewer, for example).s
        roles.addAll(request.getRoles());
       
        return new SimpleSession(request.getName(), roles, code);
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

        final IsisSessionFactoryDefault sessionFactory = new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, configuration, mockTemplateImageLoader, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockUserProfileLoader, mockPersistenceSessionFactory, servicesList);
        final IsisContext context = IsisContextStatic.createRelaxedInstance(sessionFactory);
        IsisContext.setConfiguration(sessionFactory.getConfiguration());
        sessionFactory.init();

        context.openSessionInstance(new SimpleSession("tester", new String[0], "001"));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

        sessionFactory = new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, configuration, mockTemplateImageLoader, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockUserProfileLoader, persistenceSessionFactory, servicesList);
        context = IsisContextStatic.createRelaxedInstance(sessionFactory);
        IsisContext.setConfiguration(sessionFactory.getConfiguration());
        sessionFactory.init();

        context.openSessionInstance(new SimpleSession("tester", new String[0], "001"));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

        }
        return registeredUsers;
    }

    private SimpleSession createSimpleSession(final String userName, final List<String> roles) {
        return new SimpleSession(userName, roles.toArray(new String[roles.size()]));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

@RunWith(JMock.class)
public class SimpleSessionEncodabilityNoRolesTest extends SimpleSessionEncodabilityTestAbstract {

    @Override
    protected Encodable createEncodable() {
        return new SimpleSession("joe", new String[] {});
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

public abstract class SimpleSessionEncodabilityTestAbstract extends EncodabilityContractTest {

    @Override
    protected void assertRoundtripped(final Object decodedEncodable, final Object originalEncodable) {
        final SimpleSession decoded = (SimpleSession) decodedEncodable;
        final SimpleSession original = (SimpleSession) originalEncodable;

        assertThat(decoded.getUserName(), is(equalTo(original.getUserName())));
        assertThat(decoded.getRoles(), is(equalTo(original.getRoles())));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.authentication.standard.SimpleSession

@RunWith(JMock.class)
public class SimpleSessionEncodabilityWithRolesTest extends SimpleSessionEncodabilityTestAbstract {

    @Override
    protected Encodable createEncodable() {
        return new SimpleSession("joe", new String[] { "role1", "role2" });
    }
View Full Code Here

Examples of org.apache.isis.runtime.authentication.standard.SimpleSession

    private AuthenticationSession authenticateInstance(PasswordAuthenticationRequest passwordAuthenticationRequest) {

        if ((deploymentType.isExploring() || deploymentType.isPrototyping()) &&
             logonFixture != null) {
            return new SimpleSession(logonFixture.getUsername(), logonFixture.getRoles());
        }

        if (deploymentType.isExploring()) {
            return new ExplorationSession();
        }
View Full Code Here

Examples of org.apache.shiro.session.mgt.SimpleSession

        }
        return getSimpleSession(sessionId, dbSession);
    }

    private SimpleSession getSimpleSession(Serializable sessionId, MongoDbSession dbSession) {
        final SimpleSession session = new SimpleSession();
        assignSessionId(session, sessionId);
        session.setHost(dbSession.getHost());
        session.setTimeout(dbSession.getTimeout());
        session.setStartTimestamp(dbSession.getStartTimestamp());
        session.setLastAccessTime(dbSession.getLastAccessTime());
        session.setExpired(dbSession.isExpired());
        session.setAttributes(dbSession.getAttributes());
        return session;
    }
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.