Class UserController
java.lang.Object
com.irurueta.authserver.bff.api.web.user.UserController
- All Implemented Interfaces:
UserApi
Exposes the authenticated user, as the contract
apis/bff/rest-server/bff-api-v1.yaml describes it through
the generated UserApi.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SessionUserDtoMapperMaps the signed-in user onto the generated DTO.Fields inherited from interface com.irurueta.authserver.bff.api.web.v1.generated.api.UserApi
PATH_GET_SESSION_USER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<SessionUserResponse> Returns the subject of the authenticated user.
-
Field Details
-
sessionUserDtoMapper
Maps the signed-in user onto the generated DTO.
-
-
Constructor Details
-
UserController
public UserController()
-
-
Method Details
-
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:
getSessionUserin interfaceUserApi- 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.
-