Added support for auth0-forwarded-for header to the AuthApi.login methods#302
Added support for auth0-forwarded-for header to the AuthApi.login methods#302ScottFitz wants to merge 5 commits intoauth0:masterfrom
auth0-forwarded-for header to the AuthApi.login methods#302Conversation
|
@ScottFitz Thanks for submitting this. Could you please resolve the conflicting files? Please reach out if you need help with context for those. |
|
Hi @ScottFitz, thanks for the PR! I do think we may be able to do this in a different way, by leveraging the existing request classes that allow for further customizing the request (adding headers, parameters, etc.). I think we can either change the signatures of the login APIs to return a In the short-term, you could downcast the return value to a |
|
Superseded by #307. Thanks for kicking this off! |
Changes
This PR adds support for the
auth0-forwarded-forheader to theAuthAPI.logincalls.This was added in order to avoid the common issue with anomaly dection described here: https://auth0.com/docs/authorization/avoid-common-issues-with-resource-owner-password-flow-and-anomaly-detection#send-the-user-s-ip-address-from-your-server
A new entity,
CustomHeaderOptionsis added along with the following updates to theAuthAPIclass to use that new entity:AuthAPI.login(String emailOrUsername, char[] password, CustomHeaderOptions options)method addedAuthAPI.login(String emailOrUsername, char[] password, String realm, CustomHeaderOptions options)method addedReferences
The
auth0-forwarded-forheader is required in some instances, as described here:https://auth0.com/docs/authorization/avoid-common-issues-with-resource-owner-password-flow-and-anomaly-detection#send-the-user-s-ip-address-from-your-server
Testing
Unit tests were updated, and example provided in README.
Checklist