So I am trying to use Apple Sign in with REST API within my Spring Boot backend application, everything is working fine! Until I try to access the user name, even though I ask for name in scope, apple seems not to send back the name, and the documentation says clearly that they don't provide a user info uri, however AppleJS seems to return a user object in the response payload
And yes, I have implemented a custom OIDC UserDetails Service.
public class CompactOAuth2UserService implements OAuth2UserService<OidcUserRequest, OidcUser>
.
security:
oauth2:
client:
registration:
apple:
clientId: id
clientSecret: secret
authorizationGrantType: authorization_code
redirectUri: "{baseUrl}/oauth2/callback/{registrationId}"
scope:
- openid
- name
- email
clientName: Apple
clientAuthenticationMethod: post
provider:
apple:
authorizationUri: https://appleid.apple.com/auth/authorize?response_mode=form_post&response_type=code+id_token
tokenUri: https://appleid.apple.com/auth/token
jwkSetUri: https://appleid.apple.com/auth/keys
userNameAttribute: sub
How can I get the user name? If it is not possible what is the best practice for this?