I am working on creating an api using aws api gateway service. Api gateway is backed by a lambda function written in python.
My Api gateway would be secure and I am using cognito authentication/authorization where consumers would first retrieve oauth token and pass that as Authorization header
I am planning to extend use of scope and planning to map this to my backend service to further narrow down access to underlying resources, if I can extract scope programatically
ex: if scope is myscope/tx - only get all transactions to consumer etc
My Question is that how do I retrieve this scope from oauth token ? I googled and found similar question for java , but unfortunately this was not helpful in my case, here is that url How to retrieve scopes from OAuth token within Spring boot SSO + zuul
I am also aware of using https://jwt.io/ to find this manually but in my case I am looking for a programmatic solution in python
It would be great if someone have ever done this ?
-Thanks
I googled and found similar question for java , but unfortunately this was not helpful in my case, here is that url How to retrieve scopes from OAuth token within Spring boot SSO + zuul
I am also aware of using https://jwt.io/ to find this manually but in my case I am looking for a programmatic solution in python
I am expecting solution in python