Skip to main content

Device App User Authenticate

The device app user authenticationdevice_app_user_authenticate endpoint provides secure user credential validation for mobiledevice applications and devices connecting towithin the GATE API.API system. This endpointauthentication verifiesmechanism is specifically designed for mobile and IoT devices that need to verify user login credentials andbefore returns authentication tokens or status information, enabling securegranting access to protected resources withinand the GATE ecosystem.functionality.

Base URL: https://gate.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The device app user authenticatedevice_app_user_authenticate API category is designed to handle user authentication specifically designed for mobiledevice-based applications andsuch as mobile apps, IoT devicesdevices, thatand needembedded to validate user credentials against the GATE authentication system.systems. This endpoint serves as thea primary authenticationsecure gateway for validating user credentials before allowing access to device-specific features and protected resources.

Key Features:

    Secure credential validation for device applications Token-based applications,authentication handlingflow secureDesigned for mobile and IoT device integration Returns validated user information upon successful authentication

    Common Integration Scenarios:

      Mobile application login processesflows andIoT credentialdevice verification.user verification Embedded system access control Device-to-server authentication workflows

      This authentication system is typicallyparticularly useduseful when:

      when
        Mobile applications need to authenticate users before granting access to device management features IoT devices require user validation before allowing configuration changes Third-party applicationsyou need to verify user credentials throughfrom thedevices GATEthat systemmay Devicehave registrationlimited processesconnectivity requireor userprocessing authenticationpower, asproviding parta of the setup flow

        Thestreamlined authentication process follows industry-standard security practices, ensuring that user credentials are validated securely while providing the necessary tokens or status informationoptimized for subsequentdevice API calls. This endpoint works in conjunction with other GATE API endpoints by providing the authentication foundation required for accessing protected resources.applications.


        Endpoints

        POST /device_app_user_authenticate/

        Description: Validates user credentials forprovided by device applications and returns authentication status.status along with user information. This endpoint processesis loginspecifically requestsdesigned fromfor mobile appsapps, IoT devices, and devices, verifying username/password combinations or other credentialclient typesapplications againstthat theneed GATEto userauthenticate database.users Upon successful validation, it provides authentication tokens or session information needed forbefore accessing protected API endpoints.resources.

        Use Cases:

        • Mobile app user login screen credential validationverification
        • IoT device user authentication duringbefore initialdevice setuppairing
        • Third-partyEmbedded system access control validation
        Device application integrationsession requiring user verification Multi-factor authentication workflows for device access Session token generation for authenticated device sessionsinitiation

        Full URL Example:

        https://gate.zequenze.com/api/v1/device_app_user_authenticate/
        

        Parameters:

        Parameter Type In Required Description
        data string body Yes JSON string containing user credentials (username, password)username and optional device information (device_id, app_version, platform)password)

        Request Body Structure: The data parameter should contain a JSON stringobject with the following structure:

        {
          "username": "user@example.com",
          "password": "secure_password",
          "device_id": "device_12345",
          "app_version": "2.1.0",
          "platform": "iOS"securePassword123"
        }
        

        cURL Example:

        curl -X POST "https://gate.zequenze.com/api/v1/device_app_user_authenticate/" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json" \
          -d '{
            "data": "{\"username\":\"user@example.com\",\"password\":\"secure_password\",\"device_id\":\"mobile_device_001\",\"app_version\":\"2.1.0\",\"platform\":\"iOS\securePassword123\"}"
          }'
        

        Example Response (Success):

        {
          "status": "success",
          "message": "Authentication successful",
          "user_id": 12345,
          "username": "user@example.com",
          "access_token"password": "securePassword123",
          "authenticated": true,
          "user_id": 12345,
          "device_permissions": [
            "device_control",
            "data_access",
            "settings_modify"
          ],
          "session_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
          "refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
          "token_expires_at"expires_at": "2024-01-15T22:15T18:30:00Z",
          "user_permissions": [
            "device_read",
            "device_configure",
            "inventory_view"
          ],
          "device_registered": true,
          "session_id": "sess_abc123def456"
        }
        

        Example Response (FailedAuthentication Authentication)Failed):

        {
          "status"authenticated": false,
          "error",
          "message": "Invalid credentials",
          "error_code": "AUTH_FAILED",
          "attempts_remaining"message": 2,"The "lockout_time":provided nullusername or password is incorrect"
        }
        

        Response Codes:

        Status Description
        201 CreatedSuccess - AuthenticationUser successful,authenticated tokens generatedsuccessfully
        400 Bad Request - Invalid data format or missing required fields
        401 Unauthorized - Invalid credentialsAPI or authentication failedtoken
        403 Forbidden - AccountUser lockedaccount is disabled or suspendedrestricted
        429 Too Many Requests - Rate limit exceeded for authentication attempts
        500 Internal Server Error - Server-sideAuthentication authenticationservice system errorunavailable

        Common Use Cases

        Use Case 1: Mobile App Login Flow

        WhenIntegrate usersuser openauthentication into your mobile application,application useby thissending endpointuser credentials to validate their credentials during the login process.attempts. The returnedendpoint accessreturns tokenuser information and permissions that can then be used forto all subsequent API calls, whilecustomize the refreshapp tokenexperience allowsbased foron seamlessthe sessionauthenticated renewal.user's access level.

        Use Case 2: IoT Device SetupUser Pairing

        DuringBefore theallowing initiala configurationuser ofto pair with or control an IoT devices,device, usersvalidate needtheir credentials to authenticate to associate the device with their account. This endpoint validates the user's credentials and confirmsensure they have permissionthe tonecessary registerpermissions. newThis devices.is particularly useful for smart home devices, industrial sensors, or any connected device requiring user-specific access control.

        Use Case 3: Third-PartyEmbedded IntegrationSystem Access Control

        WhenUse integratingthis with external systems that needendpoint to authenticate GATEusers users, this endpoint provides a secure wayattempting to validateaccess credentialsembedded withoutsystems exposingsuch theas mainkiosks, industrial control panels, or specialized hardware interfaces. The authentication systemensures directly.only authorized users can interact with critical systems.

        Use Case 4: Device Application Session Management

        ForEstablish authenticated sessions for device applications thatby needvalidating to maintain long-running sessions, this endpoint can be used to validateuser credentials and establishreceiving session tokens that can be refreshedused asfor needed.

        subsequent

        UseAPI Casecalls, 5:maintaining Multi-Devicesecure Authentication

        communication

        When users accessthroughout the systemuser from multiple devices, this endpoint helps manage authentication across different platforms while maintaining security and tracking device-specific access.session.


        Best Practices

        • Secure Credential Handling: Always transmit credentials over HTTPS and neveravoid log or storestoring passwords in plain text.text Theon dataclient parameterdevices. shouldConsider containimplementing properlycredential escapedcaching JSONwith strings.proper encryption for offline scenarios.

        Rate Limiting Awareness: Implement exponential backoff for failed authentication attempts to respect rate limits and prevent account lockouts. Consider implementing client-side throttling for repeated authentication failures.

        Token Management: Store theand returnedmanage accesssession tokens securely on the device using appropriate secure storage mechanisms (Keychain on iOS, Keystore on Android).device. Implement automatic token refresh usingmechanisms theand refreshhandle token beforeexpiration the access token expires.

        Rate Limiting: Implement client-side rate limitinggracefully to preventmaintain excessiveseamless authenticationuser attempts. The API may return 429 status codes if too many requests are made in a short period.experience.

        Error Handling: AlwaysProvide handleclear, authenticationuser-friendly failureserror gracefullymessages bywhile checkingavoiding theexposing error_codesensitive fieldinformation. andImplement providingproper appropriateerror userhandling feedback.for Monitornetwork attempts_remainingconnectivity toissues warncommon usersin beforedevice account lockout.applications.

        DeviceOffline Information:Considerations: IncludeFor accuratedevices devicethat informationmay inoperate theoffline, requestconsider dataimplementing tocached helpauthentication with appropriate security monitoringmeasures, andensuring device management. This informationusers can bestill usedaccess forcritical identifyingfunctionality suspiciouswhen loginconnectivity attempts.is limited.

        SessionDevice-Specific Security: TreatImplement sessionadditional tokenssecurity measures appropriate for your device type, such as sensitivebiometric dataauthentication andon implementmobile appropriatedevices logoutor mechanismshardware-based thatsecurity invalidatefor tokensIoT whendevices, usersusing signthis outendpoint as part of thea application.multi-factor authentication flow.