From 6d5a8ce364a76258a9bf31c4d7a95caa057de233 Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 15 Jan 2024 14:39:19 +0100 Subject: [PATCH] decode attempt --- subscriptions/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subscriptions/views.py b/subscriptions/views.py index 5304682..2fb4fb1 100644 --- a/subscriptions/views.py +++ b/subscriptions/views.py @@ -4,6 +4,7 @@ from django.views.decorators.csrf import csrf_exempt from .models import ASSNotification from django.conf import settings import json, jwt +import base64 import logging import logging.config @@ -30,10 +31,10 @@ def app_store_webhook(request): with open(KEY_FILE,'r') as key_file: 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)) - logger.debug('test getLogger' + str(key)) + #print('hell yeah!' + str(key)) + #logger.debug('test getLogger' + str(key)) notification = ASSNotification( content=decodedPayload,