'Apple sign in get user data with access token

I have a question about apple sign in. I just implemented an apple sign in, and I found that I received an identity token, access token, and refresh token. It seems that the identity token has user information in the json web token. I am wondering how I can use the access symbol to receive user information? Facebook and also Google has own endpoint where if I send in that endpoint access token I retrieve user data. Does apple sign in has something similar?

Thanks for the information



Solution 1:[1]

To get the user_data(email,name) I am using the following code:

if id_token:
            decoded = jwt.decode(id_token, "", verify=False)
            response_data.update(
                {"email": decoded["email"], "name": decoded["name"]}
            ) if "email" in decoded else None
            response_data.update({"uid": decoded["sub"]}) if "sub" in decoded else None

Here, after successfully receiving id token from "https://appleid.apple.com/auth/token" just decode the id_token and get data from it using the appropiriate fields. Hope this solves your problem of how to get user data from apple social login.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Always Baked