I have built a rest api backend using python 3.7 and flask. I would like to add authorization to my api end-points.
These apis would be called by another application (machine to machine flow). The calling application is expected to send an OAuth 2.0 access token with correct scope in the Authorization header.
The rest api backend is expected to fetch the access token from the header, introspect it from the external authorization server by calling it's introspection endpoint and if all is well then allow access to the resource.
I am able to implement all this myself but now planning to use a library for this purpose. I have looked at https://docs.authlib.org/en/stable/ but couldn't find an example or documentation about my use case.
Any ideas about that ? Thanks.