2

I have some python rest API that i would like to protect with azure AD. To do so I was thinking to validate the bearer token for each request according to the example: https://github.com/Azure-Samples/ms-identity-python-webapi-azurefunctions.

Is that the correct approach? What is the best practice? There is not a simpler way to managing sessions ? Something similar to flask-login but for APIs (i.e. something not based on session cookies)?

Thank you Riccardo

0

1 Answer 1

3

Is that the correct approach? What is the best practice?

Yes, it is correct, and it should be the best pratice(at least I can find). To protect the APIs with Azure AD, you always need to register an AD App for it, expose the APIs, then in your client app, add the API permission, the user login and consent the permission, get the token and call the API.

There is not a simpler way to managing sessions? Something similar to flask-login but for APIs (i.e. something not based on session cookies)?

As far as I know, there is no such thing similar to flask-login for APIs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.