Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created March 30, 2020 17:19
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/8ecf3b6953067018b0341b1cf26c32b0 to your computer and use it in GitHub Desktop.
Save groovecoder/8ecf3b6953067018b0341b1cf26c32b0 to your computer and use it in GitHub Desktop.
import requests
from django.apps import AppConfig
from django.conf import settings
class PrivateRelayConfig(AppConfig):
name = 'privaterelay'
def __init__(self, app_name, app_module):
super(PrivateRelayConfig, self).__init__(app_name, app_module)
self.fxa_verifying_keys = []
def ready(self):
resp = requests.get('%s/jwks' %
settings.SOCIALACCOUNT_PROVIDERS['fxa']['OAUTH_ENDPOINT']
)
resp_json = resp.json()
self.fxa_verifying_keys = resp_json['keys']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment