This project is not covered by Drupal’s security advisory policy.

Login by IP automatically logs in any enabled user by their IP address. It works by:

  1. Getting the IP for the current visitor - you can select REMOTE_ADDR, CLIENT_IP or whatever server variable your server uses for visitor's IP address
  2. It then checks if a user account is assigned to the current visitor IP
  3. Finally, logs in the user while checking hook_user_login() for additional actions (e.g. Salesforce account checks, etc.)

jQuery calls to the backend are also used to make sure the functionality works with external caches (e.g. Varnish) as well.

Features:

  • Dynamic DNS support - useful if your IP is dynamically allocated and changes a lot. Just insert your dDNS name (e.g. ddns.mydomain.com) instead of IP
  • Integration with the Session Limit module - https://www.drupal.org/project/session_limit
  • Integration with the Restrict by IP module - https://www.drupal.org/project/restrict_by_ip
  • IP ranges allowed:
    • single IP matches like 123.123.123.123
    • ranges using a hyphen (-) in any quadrant except the first one, for example 123.123.123.100-200 etc.
    • CIDR notation - 1.2.3.4/32, etc.
    • more options under development
  • Enable login by IP on specific pages, all pages or exclude pages. Apply this on all users or specific users.
  • Group account feature - this is used in combination with the Session Limit module. When a default session limit is set (e.g. 2 sessions per user) but the session limit value in the Login by IP table for that user is higher than default, then that account will be “marked” as a group account. A group account simply disables account editing (password, etc.). This was requested by www.joc.com for group subscriptions of thousands of users (e.g. campus students, etc.).
  • Debugging option
  • Option to enable/disable the functionality from the UI after enabling the module.
  • The ability to use hook_user_login() to run additional code logic during the login process (e.g. sync with SalesForce, etc.). Example code in the README.txt file.

This has been tested on websites with hundreds of thousands of visits per month. Initially, I tried using IP Login (https://www.drupal.org/project/ip_login) but no matter what I tried it wouldn’t work, I would get the white screen of death and an error would constantly come up in the backend.

Setup:

  1. Enable the Login by IP module and go to People > Login by IP (admin/people/login-by-ip).
  2. Click the “+ Add user” link towards the bottom of the page, insert/search for the desired username, add your IP and save settings.
  3. Open the website in a new window that doesn’t have a session opened already for the website in question (like Chrome’s incognito window) and you will be automatically logged in if your username and IP matches.
Supporting organizations: 

Project information

Releases