Class UserController

java.lang.Object
com.irurueta.authserver.bff.api.web.user.UserController
All Implemented Interfaces:
UserApi

@RestController public class UserController extends Object implements UserApi
Exposes the authenticated user, as the contract apis/bff/rest-server/bff-api-v1.yaml describes it through the generated UserApi.
  • Field Details

    • sessionUserDtoMapper

      private final SessionUserDtoMapper sessionUserDtoMapper
      Maps the signed-in user onto the generated DTO.
  • Constructor Details

    • UserController

      public UserController()
  • Method Details

    • getSessionUser

      public org.springframework.http.ResponseEntity<SessionUserResponse> getSessionUser()
      Returns the subject of the authenticated user. The security chain answers 401 before reaching this method when nobody is signed in, so the principal of the security context is always the OIDC user of the session.
      Specified by:
      getSessionUser in interface UserApi
      Returns:
      the signed-in user's subject.
      Throws:
      org.springframework.security.authentication.AuthenticationCredentialsNotFoundException - if no OIDC user is signed in, answered 401 by the chain.