Class OAuth2LoginConfigurer.UserInfoEndpointConfig

  • Enclosing class:
    OAuth2LoginConfigurer<B extends HttpSecurityBuilder<B>>

    public final class OAuth2LoginConfigurer.UserInfoEndpointConfig
    extends java.lang.Object
    Configuration options for the Authorization Server's UserInfo Endpoint.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      OAuth2LoginConfigurer<B> and()
      Returns the OAuth2LoginConfigurer for further configuration.
      OAuth2LoginConfigurer.UserInfoEndpointConfig customUserType​(java.lang.Class<? extends org.springframework.security.oauth2.core.user.OAuth2User> customUserType, java.lang.String clientRegistrationId)
      Deprecated.
      See CustomUserTypesOAuth2UserService for alternative usage.
      OAuth2LoginConfigurer.UserInfoEndpointConfig oidcUserService​(org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,​org.springframework.security.oauth2.core.oidc.user.OidcUser> oidcUserService)
      Sets the OpenID Connect 1.0 service used for obtaining the user attributes of the End-User from the UserInfo Endpoint.
      OAuth2LoginConfigurer.UserInfoEndpointConfig userAuthoritiesMapper​(org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper userAuthoritiesMapper)
      Sets the GrantedAuthoritiesMapper used for mapping OAuth2AuthenticatedPrincipal.getAuthorities().
      OAuth2LoginConfigurer.UserInfoEndpointConfig userService​(org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,​org.springframework.security.oauth2.core.user.OAuth2User> userService)
      Sets the OAuth 2.0 service used for obtaining the user attributes of the End-User from the UserInfo Endpoint.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • userService

        public OAuth2LoginConfigurer.UserInfoEndpointConfig userService​(org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,​org.springframework.security.oauth2.core.user.OAuth2User> userService)
        Sets the OAuth 2.0 service used for obtaining the user attributes of the End-User from the UserInfo Endpoint.
        Parameters:
        userService - the OAuth 2.0 service used for obtaining the user attributes of the End-User from the UserInfo Endpoint
        Returns:
        the OAuth2LoginConfigurer.UserInfoEndpointConfig for further configuration
      • oidcUserService

        public OAuth2LoginConfigurer.UserInfoEndpointConfig oidcUserService​(org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,​org.springframework.security.oauth2.core.oidc.user.OidcUser> oidcUserService)
        Sets the OpenID Connect 1.0 service used for obtaining the user attributes of the End-User from the UserInfo Endpoint.
        Parameters:
        oidcUserService - the OpenID Connect 1.0 service used for obtaining the user attributes of the End-User from the UserInfo Endpoint
        Returns:
        the OAuth2LoginConfigurer.UserInfoEndpointConfig for further configuration
      • customUserType

        @Deprecated
        public OAuth2LoginConfigurer.UserInfoEndpointConfig customUserType​(java.lang.Class<? extends org.springframework.security.oauth2.core.user.OAuth2User> customUserType,
                                                                           java.lang.String clientRegistrationId)
        Deprecated.
        See CustomUserTypesOAuth2UserService for alternative usage.
        Sets a custom OAuth2User type and associates it to the provided client registration identifier.
        Parameters:
        customUserType - a custom OAuth2User type
        clientRegistrationId - the client registration identifier
        Returns:
        the OAuth2LoginConfigurer.UserInfoEndpointConfig for further configuration
      • userAuthoritiesMapper

        public OAuth2LoginConfigurer.UserInfoEndpointConfig userAuthoritiesMapper​(org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper userAuthoritiesMapper)
        Sets the GrantedAuthoritiesMapper used for mapping OAuth2AuthenticatedPrincipal.getAuthorities().
        Parameters:
        userAuthoritiesMapper - the GrantedAuthoritiesMapper used for mapping the user's authorities
        Returns:
        the OAuth2LoginConfigurer.UserInfoEndpointConfig for further configuration