title: how to get apple oauth2 user-info-uri?
body: <p>I am making Oauth2 based login function.
  And I'm currently creating an Apple login function.</p>
  <p>Below are the application.yml and OAuth Authentication Service that I wrote.</p>
  <p>application.yml</p>
  <pre><code>registration:
            apple:
              authorization-grant-type: authorization_code
              client-id: client-id
              client-secret: client-secrit
              client-name: apple
              client-authentication-method: POST
              redirect-uri: 'https://1ac0-222-96-76-33.jp.ngrok.io/{action}/oauth2/code/{registrationId}'
  
  provider:
            apple:
              authorization-uri: https://appleid.apple.com/auth/authorize
              token-uri: https://appleid.apple.com/auth/token
              jwk-set-uri: https://appleid.apple.com/auth/keys
              user-name-attribute: name
  </code></pre>
  <p>OAuthAuthenticationService.java</p>
  <pre><code> @Override
      public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException {
          OAuth2UserService&lt;OAuth2UserRequest, OAuth2User&gt; oAuth2UserService = new DefaultOAuth2UserService();
          OAuth2User oAuth2User = oAuth2UserService.loadUser(userRequest);
          String registrationId = userRequest.getClientRegistration().getRegistrationId();
          String userNameAttributeName = userRequest.getClientRegistration()
              .getProviderDetails()
              .getUserInfoEndpoint()
              .getUserNameAttributeName();
          OAuthAttributes attributes = OAuthAttributes.of(registrationId, userNameAttributeName, oAuth2User.getAttributes());
          String socialId = attributes.getSocialId();
          boolean isExistSocialUser = socialUserService.isExistSocialUser(socialId);
          SocialUserResponseDto socialUser;
  
          if(isExistSocialUser) {
              socialUser = socialUserService.findBySocialId(socialId);
          } else {
              socialUser = socialUserService.register(attributes);
          }
  
          return new DefaultOAuth2User(socialUser.getUser().getAuthorities(), oAuth2User.getAttributes(), userNameAttributeName);
      }
  </code></pre>
  <p>SecurityConfig.java</p>
  <pre><code>@Bean
      public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
          http
              .csrf()
              .disable();
  
          http
              .authorizeRequests(request -&gt; request
                  .mvcMatchers(
                      &quot;/api/v1/mypage/**&quot;,
                      &quot;/api/v1/report/**&quot;,
                      &quot;/api/v1/inquiry/**&quot;,
                      &quot;/api/v1/join/**&quot;
                  ).hasRole(&quot;user&quot;)
  
                  .mvcMatchers(
                      HttpMethod.POST, &quot;/api/v1/notice&quot;
                  ).hasRole(&quot;admin&quot;)
  
                  .mvcMatchers(
                      HttpMethod.PUT, &quot;/api/v1/notices/**&quot;
                  ).hasRole(&quot;admin&quot;)
              )
  //            .exceptionHandling(exception -&gt; exception
  //                .authenticationEntryPoint(new Http403ForbiddenEntryPoint())
  //            )
              .formLogin(form -&gt; form
                  .successHandler(customFormLoginSuccessHandler())
                  .failureHandler(customFormLoginFailureHandler())
  
              ).oauth2Login(oauth -&gt; oauth
                  .successHandler(customOAuthLoginSuccessHandler())
                  .failureHandler(customOAuthLoginFailureHandler())
                  .userInfoEndpoint()
                  .userService(oAuthAuthenticationService)
                  .userAuthoritiesMapper(new SimpleAuthorityMapper())
              ).logout(logout -&gt; logout
                  .logoutRequestMatcher(new AntPathRequestMatcher(&quot;/logout&quot;))
              );
  
          return http.build();
      }
  </code></pre>
  <p>If you try to log in after writing the code, you will get a <code>missing_user_info_uri</code> error.</p>
  <p>It seems to be caused by the absence of user-info-uri in the provider in application.yml.</p>
  <p>However, Apple does not seem to support such user-info-uri.</p>
  <p>I want to know what I should do to deal with this error.</p>