Closed yan-hic closed 4 years ago
The username and password are already stored in the request object.
request.authorization.username
request.authorization.password
oh, didn't know that ! So a
authenticate(request.authorization.username, request.authorization.password)
will just do. Thanks !
Considering
We use flask as a proxy to a 3rd party website, and
HTTPBasicAuth()
to capture the credentials to pass on to the logon page and get the cookies (with requests).Sometimes the target website abruptly closes the connection/session and we need to re-authenticate, which we initially do in
authenticate()
Is there a way to force for a re-authentication or call
authenticate()
from another function without passing the authenticated password ?If not, I rather not store the user password in
g
or in flask'ssession
but had hoped auth.get_password()` or similar would return it.