Package org.archfirst.bfoms.domain.security

Examples of org.archfirst.bfoms.domain.security.AuthenticationResponse


        if (password == null || password.isEmpty() ) {
            throw new WebApplicationException(Response.Status.UNAUTHORIZED);
        }

        // Authenticate the user before returning any information
        AuthenticationResponse response =
            securityService.authenticateUser(username, password);
       
        // Don't return user information if authentication failed
        if (!response.isSuccess()) {
            throw new WebApplicationException(Response.Status.UNAUTHORIZED);
        }

        return mapper.map(response.getUser(), User.class);
    }
View Full Code Here


    }
   
    public Result authenticateUser(
            String username,
            String password) {
        AuthenticationResponse response =
            securityService.authenticateUser(username, password);
        if (response.isSuccess()) {
            Person person = response.getUser().getPerson();
            return new Result(true, person.getFirstName(), person.getLastName());
        }
        else {
            return new Result(false, "", "");
        }
View Full Code Here

TOP

Related Classes of org.archfirst.bfoms.domain.security.AuthenticationResponse

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.