Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Custom request loader #262

Closed
wants to merge 5 commits into from
Closed

Custom request loader #262

wants to merge 5 commits into from

Conversation

ocean1
Copy link

@ocean1 ocean1 commented Jun 6, 2014

Flask-login allows authenticating every request through a request loader (i.e. rest API auth)
and added the request loader, the api key generation is for now left to the user (i implemented it as hash of the concatenation of user email and concatenation of random/secret data) and it could be added to the UserMixin class.

there's also this p.r. for flask-login maxcountryman/flask-login#163 to avoid having unneeded cookies, at the moment is a global config, but it could be hacked to ensure that if it's a request for the request loader session can be cleaned, but would require more effort.

@coveralls
Copy link

Coverage Status

Coverage decreased (-39.11%) when pulling b8a4a28 on ocean1:custom_token_loader into faa9f65 on mattupstate:develop.

@mattupstate
Copy link
Contributor

I'm not sure I understand the motivation here, nor do I see this as a necessary feature.

@ocean1
Copy link
Author

ocean1 commented Jun 6, 2014

I couldn't find a way to have integration between the web (i.e. the user register, and the admin assign roles) and a REST API which allows the user to do actions.
Of course I don't want to rewrite integration with flask-login/flask-principal or use other means of authentication, since I'm using already flask-security and often REST APIs use an api key which is passed with form data using POST for each request (or through a custom header field)

@mattupstate mattupstate closed this May 2, 2015
@mattupstate
Copy link
Contributor

I'm afraid this is not a feature I want to support.

galeo pushed a commit to galeo/flask-security-outdated that referenced this pull request Mar 4, 2020
)

I can actually reproduce the bug report - unless the OP actually overrode the default form and
didn't put in a phone number.
But that's fine - simple and easy fix.

closes: pallets-eco#262
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants