Package com.vaadin.hilla.sso.starter
Class SingleSignOnContext
java.lang.Object
com.vaadin.hilla.sso.starter.SingleSignOnContext
Contains utility methods and information related to single sign-on.
-
Constructor Summary
ConstructorsConstructorDescriptionSingleSignOnContext(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository, SingleSignOnProperties properties, BackChannelLogoutSubscription backChannelLogoutSubscription) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<BackChannelLogoutSubscription.Message>Returns the Flux of back-channel logout messages for the current user.Returns the URL of the back-channel logout endpoint.static Optional<org.springframework.security.oauth2.core.oidc.user.OidcUser>Conveniently get the current OIDC user from context.Returns all the registered OAuth2 providers.Returns the data for the single sign-on, to be used to get everything with a single request.booleanExposes the configuration property which determines whether the back-channel logout is enabled.userRoles(org.springframework.security.oauth2.core.oidc.user.OidcUser user) Returns the roles of the user, converted by removing the standard prefix.
-
Constructor Details
-
SingleSignOnContext
public SingleSignOnContext(org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository, SingleSignOnProperties properties, BackChannelLogoutSubscription backChannelLogoutSubscription)
-
-
Method Details
-
getOidcUser
Conveniently get the current OIDC user from context.- Returns:
- the OidcUser as an Optional, or null if the user is not authenticated or is not a OIDC user
-
getRegisteredProviders
Returns all the registered OAuth2 providers.- Returns:
- a list of identifiers of the registered OAuth2 providers, as defined in the application properties.
-
getSingleSignOnData
Returns the data for the single sign-on, to be used to get everything with a single request.- Returns:
- the data for the single sign-on.
-
userRoles
public static List<String> userRoles(org.springframework.security.oauth2.core.oidc.user.OidcUser user) Returns the roles of the user, converted by removing the standard prefix.- Parameters:
user- the OIDC user.- Returns:
- the roles of the user.
-
isBackChannelLogoutEnabled
public boolean isBackChannelLogoutEnabled()Exposes the configuration property which determines whether the back-channel logout is enabled.- Returns:
- true if the back-channel logout is enabled, false otherwise.
-
getBackChannelLogoutFlux
public reactor.core.publisher.Flux<BackChannelLogoutSubscription.Message> getBackChannelLogoutFlux()Returns the Flux of back-channel logout messages for the current user.- Returns:
- a flux which is a filter of the global flux.
-
getLogoutLink
Returns the URL of the back-channel logout endpoint. This must be called by the client to finalize the logout procedure.- Returns:
- the URL of the back-channel logout endpoint as an Optional.
-