Search in sources :

Example 1 with UserCredentials

use of com.nike.cerberus.domain.UserCredentials in project cerberus by Nike-Inc.

the class UserAuthenticationController method authenticate.

@RequestMapping(value = "/user", method = GET)
public AuthResponse authenticate(@RequestHeader(value = HttpHeaders.AUTHORIZATION) String authHeader) {
    final UserCredentials credentials = extractCredentials(authHeader);
    AuthResponse authResponse;
    try {
        authResponse = authenticationService.authenticate(credentials);
    } catch (ApiException e) {
        auditLoggingFilterDetails.setAction("Failed to authenticate");
        throw e;
    }
    auditLoggingFilterDetails.setAction("Authenticated");
    return authResponse;
}
Also used : UserCredentials(com.nike.cerberus.domain.UserCredentials) AuthResponse(com.nike.cerberus.auth.connector.AuthResponse) ApiException(com.nike.backstopper.exception.ApiException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ApiException (com.nike.backstopper.exception.ApiException)1 AuthResponse (com.nike.cerberus.auth.connector.AuthResponse)1 UserCredentials (com.nike.cerberus.domain.UserCredentials)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1