Package com.saasovation.identityaccess.domain.model.identity

Examples of com.saasovation.identityaccess.domain.model.identity.UserDescriptor


        group.addUser(user);
    }

    @Transactional(readOnly=true)
    public UserDescriptor authenticateUser(AuthenticateUserCommand aCommand) {
        UserDescriptor userDescriptor =
                this.authenticationService()
                    .authenticate(
                        new TenantId(aCommand.getTenantId()),
                        aCommand.getUsername(),
                        aCommand.getPassword());
View Full Code Here


    @Transactional(readOnly=true)
    public UserDescriptor userDescriptor(
            String aTenantId,
            String aUsername) {

        UserDescriptor userDescriptor = null;

        User user = this.user(aTenantId, aUsername);

        if (user != null) {
            userDescriptor = user.userDescriptor();
View Full Code Here

    protected UserInRoleRepresentation() {
        super();
    }

    private void initializeFrom(User aUser, String aRole) {
        UserDescriptor desc = aUser.userDescriptor();
        this.setEmailAddress(desc.emailAddress());
        this.setFirstName(aUser.person().name().firstName());
        this.setLastName(aUser.person().name().lastName());
        this.setRole(aRole);
        this.setTenantId(desc.tenantId().id());
        this.setUsername(desc.username());
    }
View Full Code Here

            @PathParam("tenantId") String aTenantId,
            @PathParam("username") String aUsername,
            @PathParam("password") String aPassword,
            @Context Request aRequest) {

        UserDescriptor userDescriptor =
                this.identityApplicationService()
                    .authenticateUser(
                            new AuthenticateUserCommand(
                                    aTenantId,
                                    aUsername,
                                    aPassword));

        if (userDescriptor.isNullDescriptor()) {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }

        Response response = this.userDescriptorResponse(aRequest, userDescriptor);
View Full Code Here

    public void testAuthenticateUser() throws Exception {
        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);

        UserDescriptor userDescriptor =
                ApplicationServiceRegistry
                    .identityApplicationService()
                    .authenticateUser(new AuthenticateUserCommand(
                            user.tenantId().id(),
                            user.username(),
                            FIXTURE_PASSWORD));

        assertNotNull(userDescriptor);
        assertEquals(user.username(), userDescriptor.username());
    }
View Full Code Here

                            user.tenantId().id(),
                            user.username(),
                            FIXTURE_PASSWORD,
                            "THIS.IS.JOE'S.NEW.PASSWORD"));

        UserDescriptor userDescriptor =
                ApplicationServiceRegistry
                    .identityApplicationService()
                    .authenticateUser(new AuthenticateUserCommand(
                            user.tenantId().id(),
                            user.username(),
                            "THIS.IS.JOE'S.NEW.PASSWORD"));

        assertNotNull(userDescriptor);
        assertEquals(user.username(), userDescriptor.username());
    }
View Full Code Here

    public void testQueryUserDescriptor() throws Exception {
        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);

        UserDescriptor queriedUserDescriptor =
                ApplicationServiceRegistry
                    .identityApplicationService()
                    .userDescriptor(user.tenantId().id(), user.username());

        assertNotNull(user);
View Full Code Here

TOP

Related Classes of com.saasovation.identityaccess.domain.model.identity.UserDescriptor

Copyright © 2018 www.massapicom. 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.