Last active
October 8, 2019 13:36
-
-
Save aamishbaloch/5f2d83e19e6f73e738376fdadb1b8176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jwt | |
headers = { | |
'kid': settings.SOCIAL_AUTH_APPLE_KEY_ID | |
} | |
payload = { | |
'iss': settings.SOCIAL_AUTH_APPLE_TEAM_ID, | |
'iat': timezone.now(), | |
'exp': timezone.now() + timedelta(days=180), | |
'aud': 'https://appleid.apple.com', | |
'sub': settings.CLIENT_ID, | |
} | |
client_secret = jwt.encode( | |
payload, | |
settings.SOCIAL_AUTH_APPLE_PRIVATE_KEY, | |
algorithm='ES256', | |
headers=headers | |
).decode("utf-8") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment