Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowing authenticating using headers as well as a post request #576

Merged

Conversation

ingolfured
Copy link
Contributor

For some system, all post request data is logged in the system. When there is no possible way to change that, it's much nicer to be able to send the user email and password via the header instead of a data string in a post request. Therefore, instead of sending

curl -s -X POST -d '[email protected]&password=partypassword' -D -  'https://theurl.com/api/v1/auth/sign_in' -o /dev/null 2>&1

we can do

curl -s -X POST -H 'email: [email protected]' -H 'password: partypassword' -D -  'https://theurl.com/api/v1/auth/sign_in' -o /dev/null 2>&1

@ingolfured
Copy link
Contributor Author

You guys have any thoughts?

@lynndylanhurley
Copy link
Owner

Hi @ingolfured - this looks fine to me.

lynndylanhurley added a commit that referenced this pull request Mar 21, 2016
allowing authenticating using headers as well as a post request
@lynndylanhurley lynndylanhurley merged commit 15bf785 into lynndylanhurley:master Mar 21, 2016
@lynndylanhurley
Copy link
Owner

But if we're going to support this, should it work the same way for each action (registration, password reset, etc.)?

@ingolfured
Copy link
Contributor Author

Pretty sure this handles the other controllers as well (all calling params_for_resource.) Are you talking about writing more tests to cover that? Or am I misunderstanding something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants