Class IdentitiesPageController
java.lang.Object
com.irurueta.authserver.authorization.api.web.social.IdentitiesPageController
- All Implemented Interfaces:
IdentitiesPageApi
Serves the account page of the linked identities and the form post that starts linking another one, as the contract
apis/auth-server/web-pages/auth-server-pages-v1.yaml describes them through the generated
IdentitiesPageApi. The post records the link marker (PendingIdentityLinks) and redirects to the
provider's sign-in; the provider's answer then links the identity to the signed-in account (see
FederatedAccountResolver). The page exists whether or not a provider is configured; without one it lists the
linked identities only. The chain keeps both behind the multi-factor policy (IdentitiesPageChainCustomizer).-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringStatus of an identity that belongs to another account.(package private) static final StringPath that starts the sign-in with a provider, answered by Spring Security.private final org.springframework.beans.factory.ObjectProvider<org.springframework.security.oauth2.client.registration.ClientRegistrationRepository> Registrations of the configured providers; absent while none is configured.private final CurrentAccountResolverResolves the account of the request.(package private) static final StringName of the model attribute that holds the linked identities.private final IdentityViewMapperMaps the identities onto the view model.(package private) static final StringStatus of an identity that was linked.private final ListIdentitiesUseCaseLists the identities of an account.private final PageRendererRenders the page.private final PendingIdentityLinksKeeps the link markers.(package private) static final StringName of the model attribute that holds the providers that can be linked.private final jakarta.servlet.http.HttpServletRequestThe current request, injected as a thread-bound proxy, which holds the session.(package private) static final StringName of the model attribute that holds the outcome of the previous link.The statuses the page tells; any other value of the parameter is ignored.(package private) static final StringStatus of a provider that is not configured.(package private) static final StringName of the template of the page.Fields inherited from interface com.irurueta.authserver.authorization.api.web.pages.v1.generated.api.IdentitiesPageApi
PATH_IDENTITIES_PAGE, PATH_LINK_IDENTITY_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<IdentityProvider> Lists the providers that are configured, in the order ofIdentityProvider.org.springframework.http.ResponseEntity<String> identitiesPage(String status) Renders the page.org.springframework.http.ResponseEntity<Void> linkIdentityPage(String provider) Records the link marker and sends the browser to the provider's sign-in.private org.springframework.http.ResponseEntity<Void> Answers a redirect that the browser follows with a GET.
-
Field Details
-
VIEW_NAME
Name of the template of the page.- See Also:
-
IDENTITIES_ATTRIBUTE
Name of the model attribute that holds the linked identities.- See Also:
-
PROVIDERS_ATTRIBUTE
Name of the model attribute that holds the providers that can be linked.- See Also:
-
STATUS_ATTRIBUTE
Name of the model attribute that holds the outcome of the previous link.- See Also:
-
LINKED
Status of an identity that was linked.- See Also:
-
ALREADY_LINKED
Status of an identity that belongs to another account.- See Also:
-
UNKNOWN_PROVIDER
Status of a provider that is not configured.- See Also:
-
AUTHORIZATION_PATH
Path that starts the sign-in with a provider, answered by Spring Security.- See Also:
-
STATUSES
The statuses the page tells; any other value of the parameter is ignored. -
currentAccountResolver
Resolves the account of the request. -
listIdentitiesUseCase
Lists the identities of an account. -
identityViewMapper
Maps the identities onto the view model. -
pendingIdentityLinks
Keeps the link markers. -
clientRegistrations
private final org.springframework.beans.factory.ObjectProvider<org.springframework.security.oauth2.client.registration.ClientRegistrationRepository> clientRegistrationsRegistrations of the configured providers; absent while none is configured. -
pageRenderer
Renders the page. -
request
private final jakarta.servlet.http.HttpServletRequest requestThe current request, injected as a thread-bound proxy, which holds the session.
-
-
Constructor Details
-
IdentitiesPageController
public IdentitiesPageController()
-
-
Method Details
-
identitiesPage
Renders the page.- Specified by:
identitiesPagein interfaceIdentitiesPageApi- Parameters:
status- outcome of the previous link, ignored when it is not one of the known ones.- Returns:
- the page, never cached.
-
linkIdentityPage
Records the link marker and sends the browser to the provider's sign-in.- Specified by:
linkIdentityPagein interfaceIdentitiesPageApi- Parameters:
provider- registration id of the provider.- Returns:
- a redirect to the provider's sign-in, or to the page with
unknown-provider.
-
configuredProviders
Lists the providers that are configured, in the order ofIdentityProvider.- Returns:
- the configured providers, possibly none.
-
redirect
Answers a redirect that the browser follows with a GET.- Parameters:
location- the target, relative to the application.- Returns:
- the redirect.
-