Class FederatedOidcUserService
java.lang.Object
com.irurueta.authserver.authorization.api.web.social.FederatedOidcUserService
- All Implemented Interfaces:
org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser>
public class FederatedOidcUserService
extends Object
implements org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser>
The user service of the OpenID Connect providers (Google, Microsoft, Apple): the framework's service loads the user
as it always does (the ID token, and the UserInfo endpoint where the provider has one), then the account is resolved
(found, linked by verified e-mail or provisioned, and refused when it may not sign in) and the principal becomes the
local one, named after the account.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FederatedAccountResolverResolves the local account.private final org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest, org.springframework.security.oauth2.core.oidc.user.OidcUser> The framework's service, which loads the user the provider describes.private static final StringMessage of the failure when the user has no subject.private static final StringMessage of the failure when the framework's service answers no user.private final FederatedUserMapperBuilds the local principal. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.core.oidc.user.OidcUserloadUser(org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest request) Loads the user of a sign-in.
-
Field Details
-
MISSING_USER
Message of the failure when the framework's service answers no user.- See Also:
-
MISSING_SUBJECT
Message of the failure when the user has no subject.- See Also:
-
delegate
private final org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser> delegateThe framework's service, which loads the user the provider describes. -
accountResolver
Resolves the local account. -
userMapper
Builds the local principal.
-
-
Constructor Details
-
FederatedOidcUserService
public FederatedOidcUserService()
-
-
Method Details
-
loadUser
public org.springframework.security.oauth2.core.oidc.user.OidcUser loadUser(org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest request) throws org.springframework.security.oauth2.core.OAuth2AuthenticationException Loads the user of a sign-in.- Specified by:
loadUserin interfaceorg.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser> - Parameters:
request- the request, with the registration, the access token and the ID token.- Returns:
- the local principal.
- Throws:
org.springframework.security.oauth2.core.OAuth2AuthenticationException- if the provider is unknown or the sign-in is refused.
-