Login by IP

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:
Getting the IP for the current visitor - it uses the high availability service from https://www.ipify.org
It then checks if a user account is assigned to current client IP
Login the user

All of it through jQuery calls to the backend of Drupal so there’s no actual slowness to the visitor. The process is a bit more involved but that’s the gist of it.

- Integration with the Session Limit module - https://www.drupalproject.org/project/session_limit
- Integration with the Restrict by IP module - https://www.drupalproject.org/project/restrict_by_ip
- IP client detection using a high availability service - https://www.ipify.org
- IP ranges allowed:
- single IP matches like
- ranges using a hyphen (-) in any quadrant except the first one, for example 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.
- 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). Example code in the README.txt file.

This has been tested on websites with hundreds of thousands of visitors per month. Initially, I tried using IP Login (https://www.drupalproject.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.

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

Full documentation with examples at https://www.condurachi.ro/login-by-ip.

Supporting organizations: 

Login by IP项目的Drush安装命令:复制到剪贴板





7.x-1.0tar.gz (16.74 KB) | zip (18.83 KB)2017年8月11日发布说明简 | 繁 | 更多