For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Login Protection

Article Topics: Members

The Login Protection page lists banned and whitelisted members, allowing you to manage member access efficiently. It provides detailed information on ban and whitelist actions, including the reasons, timestamps, and whether the action was performed automatically or by an admin.

Table Details

The Bans/Whitelist table has pieces of information that are associated with a recorded Ban or Whitelist action, such as:

  • Member: The Member who is Banned or Whitelisted.

  • Start: The effective start time of the Ban or Whitelist.

  • End: The effective end time of the Ban or Whitelist.

  • Status: Whether the ban or whitelist is still active or has finished.

  • Added By: The name of the administrator or system that enforced the ban, along with the reasoning.

  • Actions: The action to perform on the specific Ban or Whitelist, whether that is to:

    • Update: Modify the Reasoning and/or End date.

    • Remove: Remove the ban or whitelist.

Adding a Ban

To add a new ban, ensure you have the "Bans" tab highlighted, then click the "Add Ban" button at the top-right of the page. This will display a widget where you can search for a member by their ID or username, provide an optional reason for the ban, and select the end time for the ban.

Adding a Whitelist

To add a new whitelist, ensure the Whitelist tab is highlighted, then click the "Add Whitelist" button at the top-right of the page. This will display a widget where you can search for a member by their ID or username, optionally provide a reason for the whitelist, and select the whitelist end time.

External Login Protection using REST API

Please note: This assumes you have OpenID connected and loginlog functioning on member records; if not, you will need to set this up first.

This section explains how to use the NATS REST API to use Login Protection (Password Sharing Prevention) logic in external member applications and non-CMS systems.

Required Endpoints

Action
Method
Endpoint
Description

Check List

GET

/api/member/login_list_check

Checks if a member is currently on the banned or whitelist.

Count IPs

GET

/api/member/login_ips

Returns unique IP addresses used by the member within the scan window.

Ban Member

POST

/api/member/ban

Explicitly bans a member for password sharing or security violations.

Record Login

POST

/api/member/login

Logs a successful login or a denied attempt in NATS.

Workflow

To replicate NATS' internal login protection logic in an external system, follow these steps during authentication:

1. Check for Existing Restrictions

Before allowing authentication, verify whether the member is currently banned.

Request: GET /api/member/login_list_check?memberid=123&list=banned

  • Response (Not Banned): {"result": false}

  • Response (Banned): Returns the active ban record details. If a ban is active, deny login access .

If no active ban exists, check if the member is whitelisted: GET /api/member/login_list_check?memberid=123&list=whitelist

  • If whitelisted ("result" contains an entry record), skip automated IP limit checks and proceed directly to Step 4 (Record Login).

/api/member/login_list_check

2. Verify Unique IP Count

If the member is not whitelisted, retrieve the list of unique IP addresses used by the member within the configured scan window (MEMBER_LOGIN_PROTECTION_SCAN_WINDOW_HOURS).

Request: GET /api/member/login_ips?memberid=123

Response Example:

Count the total number of unique IPs returned (including the current user's IP address if it is not already present in the list). Compare this count against your configured limit (MEMBER_LOGIN_PROTECTION_ALLOWED_IPS_COUNT).

/api/member/login_ips

3. Trigger Ban (If Limit Exceeded)

If the unique IP count exceeds your allowed limit, issue a ban via the API.

Request: POST /api/member/ban

Body:

Response Example:

/api/member/ban

4. Record the Attempt

Regardless of success or failure, record the activity to maintain accurate logs.

For Successful Login:

POST /member/login

Body:

For Denied/Banned Attempt:

POST /member/login

Body:

/api/member/loginMember OverviewPassword Sharing Prevention

Last updated

Was this helpful?