Skip to content

Instantly share code, notes, and snippets.

View tmpapageorgiou's full-sized avatar

Thiago Papageorgiou tmpapageorgiou

  • Lululemon
  • Vancouver, Canada
View GitHub Profile
@tmpapageorgiou
tmpapageorgiou / jwt_validation3.py
Last active December 10, 2018 20:24
Using modulus and expoent directly to validate azure ad jwt token
import jwt
import requests
import base64
from jose.utils import base64url_decode
from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicNumbers
from cryptography.hazmat.primitives import serialization