Portal Login
The Portal Login API
provides secureenables authenticationfunctionalityand session management foraccessingcaptivetheportalGATE system portal.networks. This endpoint handles user authenticationandflows,sessioncapturesmanagement,devicereturning the necessary tokensinformation, anduserestablishesinformationnetwork access sessions with configurable timeout parameters forsubsequentWiFiAPIhotspotscalls.and access control systems.
Base URL: https://gate.zequenze.com/api/v1
Authentication: ThisAll endpoint is used to obtain authentication tokens and does notendpoints require a Bearer token:
Authorization: Bearer <your-api-token>
itself.
Overview
The Portal Login API category containsprovides essential functionality for captive portal authentication systems. When users connect to a singleWiFi butnetwork crucialwith endpointa thatcaptive servesportal, asthis theAPI entryprocesses pointtheir forlogin userattempts authenticationand inestablishes theauthenticated GATEsessions.
Key This endpoint is designed to:Concepts:
AuthenticateuserCaptivecredentialsPortalagainstAuthentication:theInterceptsGATEnetworksystemtraffic until users authenticateEstablishsecureDevice Tracking: Captures MAC addresses and IP information for access control
UnlikeCommon otherIntegration APIScenarios:
The API handles the portaltechnical loginaspects endpointof issession publiclyestablishment accessiblewhile butallowing requiresflexibility validin authentication methods and user credentialsexperience in the request body. The response from a successful login typically includes access tokens, refresh tokens, user profile data, and session information that will be used for all subsequent authenticated requests.
This endpoint is essential for any application or service that needs to integrate with the GATE portal functionality, whether it's a web application, mobile app, or automated system requiring authenticated access.design.
Endpoints
POST /portal_login/
Description: Authenticates user credentials and establishesExecutes a portal login operation to authenticate a user and establish a network access session. This endpoint processes authentication data, validates credentials, and creates an authorized session for the providedrequesting login credentials against the GATE system and returns authentication tokens alongdevice with userconfigurable profiletimeout information upon successful authentication.parameters.
Use Cases:
UserAuthenticate hotel guests using room number and last name
Full URL Example:
https://gate.zequenze.com/api/v1/portal_login/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| data | string | body | Yes | JSON string containing |
Request Body Structure:
The data parameter should contain a JSON stringobject with theauthentication followingdetails, structure:device information, and session parameters.
{
"username": "user@example.com",
"password": "user_password",
"remember_me": true,
"device_id": "unique_device_identifier"
}
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": "{\"username\uid\":\"user@example.guest@hotel.com\",\"password\mac\":\"secure_password\aa:bb:cc:dd:ee:ff\",\"remember_me\":true,\"device_id\ap_mac\":\"web_client_001\11:22:33:44:55:66\"},\"ip\":\"192.168.1.100\",\"original_url\":\"https://google.com\",\"controller_address\":\"192.168.1.1\",\"session_timeout\":7200,\"idle_timeout\":1800}"
}'
Example Response:
{
"success": true,
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"user": {
"id"page_id": 12345,
"username"original_url": "user@example.https://google.com",
"email"ap_mac": "user@example.11:22:33:44:55:66",
"mac": "aa:bb:cc:dd:ee:ff",
"ip": "192.168.1.100",
"uid": "guest@hotel.com",
"first_name"controller_address": "John"192.168.1.1",
"last_name"session_timeout": "Doe",7200,
"organization_id"idle_timeout": 789,
"organization_name": "ACME Corporation",
"role": "admin",
"permissions": [
"device_management",
"user_management",
"reporting"
],
"last_login": "2024-01-15T10:30:00Z",
"profile_complete": true
},
"session": {
"session_id": "sess_abc123def456",
"expires_at": "2024-01-15T14:30:00Z",
"device_registered": true
}1800
}
Response Fields:
Response Codes:
| Status | Description |
|---|---|
| 201 | Success - |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - Invalid |
Common Use Cases
Use Case 1: WebHotel ApplicationGuest UserWiFi LoginAuthentication
ImplementProcess userhotel authenticationguest inlogin using room number and last name, establishing a web24-hour applicationsession thatwith needs30-minute toidle accesstimeout GATE portal features. After successful login, storefor the accessguest token for subsequent API calls and use the refresh token to maintain the session.network.
Use Case 2: MobileCoffee AppShop AuthenticationSocial Login
Authenticate mobilecustomers appthrough userssocial andmedia establishcredentials, persistentcreating sessionsa using2-hour devicesession identification.that Theautomatically remember_meexpires flagwhen andinactive device_idfor help15 maintain user sessions across app launches.minutes.
Use Case 3: AutomatedCorporate SystemGuest AuthenticationAccess
SetValidate guest credentials with sponsor approval, setting up automatedrestricted systemsnetwork oraccess backgroundwith servicescustom thatsession needduration to perform actionsbased on behalfapproval of a user account. Store credentials securely and handle token refresh automatically.level.
Use Case 4: APIPublic IntegrationHotspot TestingTerms Acceptance
DuringProcess developmentterms andof testing,service use this endpoint to obtain valid authentication tokensacceptance for testingpublic otherWiFi, APIestablishing endpointsbasic thatinternet requireaccess authentication.with standard timeout policies.
Use Case 5: Multi-OrganizationRetail AccessCustomer Registration
ForHandle usersnew customer registration with accessemail toverification, multiplecreating organizations,personalized usesessions thewith returnedloyalty organizationprogram information to determine available features and data access levels within the GATE system.integration.
Best Practices
Authentication Data Security:
- Always
SecuretransmitCredentialauthenticationHandling:Never log or store user passwords in plain text. Ensure credentials are transmitteddata over HTTPS
Tokenrate Management:limiting to prevent brute force attacks
Session refresh token before the access token expires.Management:
Device Tracking:
Error Handling:
Deviceretry Management: Use consistent device_id values for the same client to helplogic with session management and security monitoring.
Session Monitoring: Track session expiration times and implement logout functionality that properly invalidates tokens when users end their sessions.
Rate Limit Awareness: Implement exponential backoff for failedtemporary login attempts to avoid triggering rate limits, especially in automated systems.
Security Logging: Log authenticationfailed events (successful logins, failures, suspicious activities)attempts for security monitoring and compliance purposes.
Network Integration: