matt
matt

Reputation: 106

Flask redirect with authentication

In Flask, how would I redirect AND provide credentials.

For example:

redirect('http://url:5000', auth=(username, password))

Upvotes: 0

Views: 1230

Answers (1)

muttonchops
muttonchops

Reputation: 104

redirect(url_for('.view_function', username=username, password=password))

These parameters can then be accessed as parameters passed to your view function. However, this isn't the right way to keep a track authorization (I'm assuming that is what you're trying to do here). Your information could easily be breached as all credentials (including the password) would be available in url for anyone to see and access.
Keeping that in mind, you should look into Flask-login. It's a pretty secure login manager.

Upvotes: 4

Related Questions