azure-activedirectory-library-for-python icon indicating copy to clipboard operation
azure-activedirectory-library-for-python copied to clipboard

How to validate a token received from another API?

Open phanisrinath opened this issue 7 years ago • 3 comments

Hello Team,

I have a python api that is meant to receive a request from another api. But to secure my api i would need to validate an incoming JWT. Is there a straight forward way of doing this instead of writing our own code? (I am sure there is a way to validate an incoming JWT in C# but couldnt find anything specific for python). The only resource that i have found on this is the following link. https://aboutsimon.com/blog/2017/12/05/Azure-ActiveDirectory-JWT-Token-Validation-With-Python.html

Any help in this regard would be of a great help

Regards, Srinath

phanisrinath avatar Aug 24 '18 13:08 phanisrinath

ADAL Python is designed to be a client-side library for acquiring (and caching) tokens. Validation of a token is out of the scope of this ADAL Python library. So I'll mark this as both Wontfix and Enhancement - a rare combination indeed - for now. We will revisit this in future, possibly as a different project in its own.

rayluo avatar Aug 27 '18 21:08 rayluo

There is a pending question create by me at stack overflow asking exactly the same. I have tried the same solution defined in the blog post mentioned by @rayluo, but I did not succeed so far. If anybody succeed on validate JWT token, I would love to chat with you.

tmpapageorgiou avatar Dec 06 '18 21:12 tmpapageorgiou

As a matter of fact i was able to do it. but had to write my own code based on the link had mentioned earlier in the post. Do mail me in case you need to any help

phanisrinath avatar Dec 10 '18 05:12 phanisrinath

Closing this issue, as ADAL Python already reaches its end-of-life. Please subscribe the same token validation topic in MSAL Python and another one.

rayluo avatar Jul 02 '23 06:07 rayluo