decode attempt

main
Laurent 2 years ago
parent 2f5c52e5c1
commit 6d5a8ce364
  1. 7
      subscriptions/views.py

@ -4,6 +4,7 @@ from django.views.decorators.csrf import csrf_exempt
from .models import ASSNotification from .models import ASSNotification
from django.conf import settings from django.conf import settings
import json, jwt import json, jwt
import base64
import logging import logging
import logging.config import logging.config
@ -30,10 +31,10 @@ def app_store_webhook(request):
with open(KEY_FILE,'r') as key_file: with open(KEY_FILE,'r') as key_file:
key = ''.join(key_file.readlines()) key = ''.join(key_file.readlines())
decodedPayload = jwt.decode(signedPayload, key, algorithms=['ES256']) decodedPayload = jwt.decode(signedPayload, b64decode(key), algorithms=['ES256'])
print('hell yeah!' + str(key)) #print('hell yeah!' + str(key))
logger.debug('test getLogger' + str(key)) #logger.debug('test getLogger' + str(key))
notification = ASSNotification( notification = ASSNotification(
content=decodedPayload, content=decodedPayload,

Loading…
Cancel
Save