I’m hoping to run unit tests against some routes of my “Calculations” API which is a flask back end.
Basic authentication is working fine, I can use the the automatically generated “Calculations (Test Client)”'s id and secret pair to grab an access_token. So for routes that don’t depend on a user’s credentials I can test those.
However, for several routes I need to have the user’s identity that is obtained from the access_token.
Is there a way, in Python, to call the Auth0 authentication API, give it a username and password and receive an access_token for testing purposes?
I see some semblance of this being possible in the auth0.js, but am wanting a direct example.
If this isn’t possible in Python, then is there an example of doing this in js? In which case I’d have to create a node app and get Python to call it.
As it is now, I’m manually logging in as a test user, then taking the access_token from my browser’s local storage to use in my tests.