Skip to content

Instantly share code, notes, and snippets.

@fadur
Created January 9, 2024 13:33
Show Gist options
  • Save fadur/bd783ac7c65f70f0e35c8818bb96c1da to your computer and use it in GitHub Desktop.
Save fadur/bd783ac7c65f70f0e35c8818bb96c1da to your computer and use it in GitHub Desktop.
import asyncio
from okta_jwt_verifier import AccessTokenVerifier
from pprint import pprint as print
ISSUER = "https://nn.oktapreview.com"
async def main(access_token):
jwt_verifier = AccessTokenVerifier(issuer=ISSUER, audience="api://default")
try:
await jwt_verifier.verify(access_token)
except Exception as e:
raise e
if __name__ == "__main__":
path = "access_token.txt"
with open(path, "r") as f:
loop = asyncio.get_event_loop()
access_token = f.read()
loop.run_until_complete(main(access_token))
loop.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment