Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created March 30, 2020 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groovecoder/bf2633f3e55beaeba13c285929526b18 to your computer and use it in GitHub Desktop.
Save groovecoder/bf2633f3e55beaeba13c285929526b18 to your computer and use it in GitHub Desktop.
import requests
from jwt import jwk_from_dict
from django.apps import AppConfig
from django.conf import settings
class PrivateRelayConfig(AppConfig):
name = 'privaterelay'
def ready(self):
resp = requests.get('%s/jwks' %
settings.SOCIALACCOUNT_PROVIDERS['fxa']['OAUTH_ENDPOINT']
)
resp_json = resp.json()
for fxa_verifying_key_json in resp_json['keys']:
fxa_verifying_key = jwk_from_dict(fxa_verifying_key_json)
print(fxa_verifying_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment