Portal Login
Endpoints Summary
POST
/portal_login/
Swagger ↗
The
Portal Loginportal_login APIenablesprovides functionality for managing captive portal authentication flows, allowing access points to redirect users through a centralized authentication system. This endpoint is primarily used in WiFi network environments where user authentication and session managementforarecaptiverequiredportalbeforenetworks.grantingThisinternetendpoint handles user authentication flows, captures device information, and establishes network access sessions with configurable timeout parameters for WiFi hotspots and access control systems.access.
Base URL: https://gate.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Portal Loginportal_login API category providesis essential functionalitydesigned for WiFi captive portal authenticationsystems systems.that Whenneed to authenticate users connectbefore to a WiFigranting network withaccess. a captive portal, thisThis API processeshandles theirthe logincritical attemptshandoff between access points, controllers, and establishesthe authenticatedauthentication sessions.platform.
Key Concepts:
-
Captive Portal
AuthenticationFlow:Intercepts network traffic untilWhen usersauthenticate
Common Integration Scenarios:
- Hotel WiFi
loginsystemsthat requirerequiring roomcredentials
The APIportal_login handlesendpoint serves as the technical aspects of session establishment while allowing flexibility in authentication methodsgateway, processing user credentials and userdevice experienceinformation design.to establish authorized network sessions.
Endpoints
POST /portal_login/
Description: Executes a portal login operation to authenticate a user device and establish a network access session. This endpoint processes authentication data,data validatesfrom credentials,captive portals and creates an authorized sessionsessions with the network controller, enabling internet access for the requestingauthenticated device with configurable timeout parameters.device.
Use Cases:
- Authenticate hotel guests using room
numbercredentialsandbeforelastgrantingnameWiFi access - Process corporate visitor registration and create temporary network access
Full URL Example:
https://gate.zequenze.com/api/v1/portal_login/
Request Body Parameters:
| Parameter | Type |
|---|
RequestData BodyObject Structure:
The data parameter should contain a JSON objectstring with the following authentication details,information:
cURL Example:
curl -X POST "https://gate.zequenze.com/api/v1/portal_login/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": "{\"uid\":\"guest@hotel.com\",\"mac\ap_mac\":\"aa:bb:cc:dd:ee:ff\",\"ap_mac\mac\":\"11:22:33:44:55:66\",\"ip\":\"192.168.1.100\",\"original_url\":\"https://www.google.com\",\"controller_address\":\"192.168.1.1\",\"session_timeout\":3600,\"idle_timeout\":1800}"
}'
Example Request Body:
{
"data": "{\"uid\":\"room_401\",\"ap_mac\":\"aa:bb:cc:dd:ee:ff\",\"mac\":\"11:22:33:44:55:66\",\"ip\":\"192.168.1.100\",\"original_url\":\"https://www.example.com\",\"controller_address\":\"192.168.1.1\",\"session_timeout\":7200,\"idle_timeout\":1800}3600}"
}'
Example Response:
{
"page_id": 12345,
"original_url": "https://google.www.example.com",
"ap_mac": "aa:bb:cc:dd:ee:ff",
"mac": "11:22:33:44:55:66",
"mac": "aa:bb:cc:dd:ee:ff",
"ip": "192.168.1.100",
"uid": "guest@hotel.com"room_401",
"controller_address": "192.168.1.1",
"session_timeout": 7200,
"idle_timeout": 18003600
}
Response Fields:
| Field | Type |
|---|
Response Codes:
| Status | Description |
|---|---|
| 201 | Success - Portal login completed |
| 400 | Bad Request - Invalid data format or missing required fields |
| 401 | Unauthorized - Invalid or missing API token |
| 422 | Unprocessable Entity - Authentication failed or |
| 500 | Internal Server Error - |
Common Use Cases
Use Case 1: Hotel Guest WiFi Authentication
ProcessAuthenticate hotel guest loginguests using their room number and last name,name. establishingThe portal captures the guest's device information and creates a 24-hour session withthat 30-minuteexpires idleat timeoutcheckout fortime.
Implementation: Use the guestguest's network.room number as the uid and set session_timeout based on their stay duration.
Use Case 2: CoffeeCorporate ShopGuest Social LoginNetwork
AuthenticateProcess customersvisitor throughregistration socialwhere mediaguests credentials,provide creatingtheir aemail 2-houraddress sessionand thataccept automaticallyterms expiresof whenservice inactivebefore foraccessing 15the minutes.corporate guest WiFi.
Implementation: Use the guest's email as the uid and include the original destination URL to redirect them after authentication.
Use Case 3: CorporatePublic GuestWiFi Accesswith Social Login
ValidateHandle guestauthentication credentialsflows withwhere sponsorusers approval,log settingin upthrough restrictedsocial networkmedia platforms (Facebook, Google) to access withfree customWiFi in retail locations.
Implementation: Use the social media user ID as the uid and set appropriate session durationtimeouts basedfor onfair approvalusage level.policies.
Use Case 4: PublicEvent HotspotWiFi Terms AcceptanceManagement
ProcessManage termsWiFi access for conference attendees using registration codes or badge scan data, with sessions that expire at the end of serviceeach acceptanceday.
Implementation: Use attendee registration codes as the uid with daily session timeouts and controller integration for publicbandwidth WiFi, establishing basic internet access with standard timeout policies.
Use Case 5: Retail Customer Registration
Handle new customer registration with email verification, creating personalized sessions with loyalty program integration.management.
Best Practices
Authentication Data Security:Format:
- Always
transmitensureauthenticationthedataoverparameterHTTPScontains properly escaped JSON strings - Validate
andMACsanitizeaddressesallareuserininputsthe correct format (aa:bb:cc:dd:ee:ff) beforeprocessingsending ImplementIncluderatesessionlimitingtimeouts to preventbrute force attacks
Session Management:
Device Tracking:
Error Handling:
Provide clear error messages for authentication failures without revealing system details
NetworkSecurity Integration:Considerations:
EnsureNeveryourlogportalorsystemexposecanthecommunicatefull API token in client-side code
Performance Tips:
Session Management:
page_id for session tracking and potential logout operations
Respect the configured timeout values and handle session expiration gracefully
Consider implementing session renewal for long-term users