Auth0 Home Blog Docs

ByPass MFA with IP address

mfa

#1

Hi. I have a javascript application with embedded Lock deployed on the server with IP 172.18.13.100. I want to create a rule which will check the ip address and bypass MFA with some certain IP.

In the Rule I get the IP address in the context object (context.request.ip). But when I check log the context.request.ip give me some strange ip not the “172.18.13.100”.

Could you please advise how can I get the IP of my application using embedded Lock in RULE?


#3

:wave: @it4

Can you please confirm if I understood correctly, are you wanting to allow only users with a certain IP address to access your application? You could use the IP Address Whitelist Rule. If you are using the Try this rule button, you’ll need to edit the context in line 11, "ip": "X.X.X.X", to match the IP you whitelisted to see a successful try.

Please let me know if I misunderstood and if you able to share the Rule you are creating?