callicoder / spring-boot-react-oauth2-social-login-demo

Spring Boot React OAuth2 Social Login with Google, Facebook, and Github
1.44k stars 703 forks source link

[question] how to implement Sign in with apple ? #29

Open gruming opened 4 years ago

gruming commented 4 years ago

Hi.

I am developing a small app

We are developing social login using the project.

The problem is to use sign in with apple in the IOS app.

Currently, add an apple provider as shown below to configure and receive the access token.

  security:
    oauth2:
      client:
        registration:
          google:
            clientId: {clientId}
            clientSecret: {clientSecret}
            redirectUri: "{baseUrl}/oauth2/callback/{registrationId}"
            scope:
              - email
              - profile
          facebook:
            clientId: {clientId}
            clientSecret: {clientSecret}
            redirectUri: "{baseUrl}/oauth2/callback/{registrationId}"
            scope:
              - email
              - public_profile
          apple:
            clientId: "com.example.appId"
            clientSecret: "eyJhbGciOiJFUzI1NiIsImtp..."
            redirectUri: "{baseUrl}/oauth2/callback/{registrationId}"
            clientAuthenticationMethod: post
            authorizationGrantType: authorization_code
        provider:
          facebook:
            authorizationUri: https://www.facebook.com/v3.0/dialog/oauth
            tokenUri: https://graph.facebook.com/v3.0/oauth/access_token
            userInfoUri: https://graph.facebook.com/v3.0/me?fields=id,first_name,middle_name,last_name,name,email,verified,is_verified,picture.width(250).height(250)
          apple:
            authorizationUri: https://appleid.apple.com/auth/authorize
            tokenUri: https://appleid.apple.com/auth/token
            userInfoUri: https://appleid.apple.com/auth/token <<< ???

However, it is not possible to get user information with the corresponding access token.

How can I get user information?

Ps Thank you for opening this project.

SelanDeemantha commented 3 years ago

Hi, @gruming Did you find out a solution for connecting Apple as an OAuth Provider to Spring Security OAuth2_Client?

techiesnarender commented 1 year ago

Hi, @gruming please provide a solution if you find It.