Created
January 9, 2024 13:33
-
-
Save fadur/bd783ac7c65f70f0e35c8818bb96c1da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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