Class OAuthService

java.lang.Object
com.lpvs.service.OAuthService
All Implemented Interfaces:
org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>

@Service public class OAuthService extends Object implements org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>
Service for handling OAuth2 user information.
  • Constructor Details

    • OAuthService

      @Autowired public OAuthService(LPVSMemberRepository lpvsMemberRepository)
      Constructor for OAuthService.
      Parameters:
      lpvsMemberRepository - Repository for storing LPVSMember entities.
  • Method Details

    • loadUser

      public org.springframework.security.oauth2.core.user.OAuth2User loadUser(org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest userRequest) throws org.springframework.security.oauth2.core.OAuth2AuthenticationException
      Loads user information from the OAuth2 provider.
      Specified by:
      loadUser in interface org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>
      Parameters:
      userRequest - The OAuth2 user request.
      Returns:
      OAuth2User with custom attributes.
      Throws:
      org.springframework.security.oauth2.core.OAuth2AuthenticationException - If an OAuth2 authentication error occurs.