From 11e4a12c83754bf6a7ffe95f6bcc80266113b0a9 Mon Sep 17 00:00:00 2001
From: Adrian_Cin
Date: Mon, 14 Jun 2021 16:17:47 +0700
Subject: [PATCH] Correct public key format
Keycloak returns public key in PEM format
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 63abe49..28b218d 100644
--- a/README.md
+++ b/README.md
@@ -98,7 +98,7 @@ token_rpt_info = keycloak_openid.introspect(keycloak_openid.introspect(token['ac
token_info = keycloak_openid.introspect(token['access_token'])
# Decode Token
-KEYCLOAK_PUBLIC_KEY = keycloak_openid.public_key()
+KEYCLOAK_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\n" + keycloak_openid.public_key() + "\n-----END PUBLIC KEY-----"
options = {"verify_signature": True, "verify_aud": True, "verify_exp": True}
token_info = keycloak_openid.decode_token(token['access_token'], key=KEYCLOAK_PUBLIC_KEY, options=options)