0

I have to replace a backend api from netcore to flask python.

The backend is serving apis for a single page application that's autenticate to Azure Active Directory via oauth 2 implicit flow.

Both application (Single Page and Backend) are separately registered on Azure Active Directory and this article is a good description of my scenario.

https://devblogs.microsoft.com/premier-developer/using-adal-js-with-angular4/

Actually I'm trying to implement oauth api protection by flask backend, but the documentation and resources that i found starts always from a login.

In my case, login is performed by an angular app (with adal.js) via implicit flow, than all protected apis requests has bearer token that backend should manage.

I've tried authlib, flask-dance libs but I'm missing something and I cannot perform a working scheleton.

Does anyone can helps?

Claudio
  • 3,060
  • 10
  • 17
  • I found a solution: implementing from scratch the token validation following [this](https://auth0.com/docs/quickstart/backend/python/01-authorization) or [this](https://stackoverflow.com/a/43145184/3120219). Is there any way to do the same with authlib ? – Claudio Jul 27 '19 at 21:20
  • If it helps I have a write up on Azure AD token validation here: https://authguidance.com/2017/12/06/azure-ad-api-token-validation/ with some code here: https://github.com/authguidance-examples/authguidance.websample.azure/blob/master/api/src/plumbing/oauth/authenticator.ts - possible there's a simpler option though .. – Gary Archer Jul 30 '19 at 18:46
  • My main issue is on api side (python), thanks for sharing anyway. – Claudio Jul 31 '19 at 08:49

0 Answers0