Class SessionUserDtoMapper
java.lang.Object
com.irurueta.authserver.bff.api.web.user.SessionUserDtoMapper
Maps the OpenID Connect user of the BFF session onto the DTO generated from the contract. The BFF has no domain
yet, so the source is the Spring Security principal; only UI-safe claims are ever exposed, never a token.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringID token claim holding the roles of the user, as issued by the authorization server. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringdisplayName(org.springframework.security.oauth2.core.oidc.user.OidcUser user) Picks the best display name the ID token offers.toResponse(org.springframework.security.oauth2.core.oidc.user.OidcUser user) Maps the signed-in user.
-
Field Details
-
ROLES_CLAIM
ID token claim holding the roles of the user, as issued by the authorization server.- See Also:
-
-
Constructor Details
-
SessionUserDtoMapper
public SessionUserDtoMapper()
-
-
Method Details
-
toResponse
public SessionUserResponse toResponse(org.springframework.security.oauth2.core.oidc.user.OidcUser user) Maps the signed-in user.- Parameters:
user- the authenticated OIDC user.- Returns:
- its web representation: subject, display name, email and roles.
-
displayName
Picks the best display name the ID token offers.- Parameters:
user- the authenticated OIDC user.- Returns:
- the full name, else the preferred username, else
null.
-