Omada External Portal Server for v5.14+ ERROR -41501 Failed to authenticate

Omada External Portal Server for v5.14+ ERROR -41501 Failed to authenticate

Omada External Portal Server for v5.14+ ERROR -41501 Failed to authenticate
Omada External Portal Server for v5.14+ ERROR -41501 Failed to authenticate
a week ago - last edited a week ago
Hardware Version: V5
Firmware Version: 5.14.32.2

I'm trying to develop my own External Portal Server for authentication and I'm following the steps from this page API and Code Sample for External Portal Server (Omada Controller 5.0.15 or above). I was able to login but when trying to authenticate a voucher code im getting an error code -41501 "Failed to authenticate".

I'm not sure what I'm missing.

 

Here is the sample request that i was sending

URL: BASE_URL:8043/OMADACID/api/v2/hotspot/extPortal/auth

METHOD: POST

HEADERS: 

"Content-Type": "application/json",

"Csrf-Token": token (from login),

"Cookie": cookies (from login),

Body:

{
    "clientMac": "CLIENTMAC",
    "apMac": "APMAC",
    "ssidName": "SITENAME",
    "site": "SITEID",
    "radioId": 1,
    "voucherCode": "336109",
    "authType": 3
}

 

For login, I used my controller user and operator user, both are not working and getting the same error.

 

Is there a full documentation of this where we can see the options and payloads required?

Thanks

  0      
  0      
#1
Options
1 Reply
Re:Omada External Portal Server for v5.14+ ERROR -41501 Failed to authenticate
a week ago

Hi  @Lipton 

 

Here are some possible reasons and solutions for the error code -41501 "Failed to authenticate" you're encountering when trying to authenticate a voucher code:

1. Check the Voucher Code
- **Validity**: Ensure that the voucher code you're using is valid and has not expired. You can check the validity of the voucher code in the Omada Controller's voucher management section.
- **Correctness**: Double-check that the voucher code is entered correctly in the request body. A small typo can lead to authentication failure.

 

2. Verify the Request Parameters
- **ClientMac**: Make sure the `clientMac` parameter matches the MAC address of the client device attempting to authenticate. It should be in the correct format (e.g., `00:11:22:33:44:55`).
- **apMac**: Confirm that the `apMac` parameter corresponds to the MAC address of the access point to which the client is connected.
- **ssidName**: Ensure that the `ssidName` parameter matches the name of the SSID the client is connected to.
- **site**: Verify that the `site` parameter is set to the correct site ID where the authentication is being attempted.
- **radioId**: Check that the `radioId` parameter is set to the correct radio ID (0 for 2.4G, 1 for 5G) of the band the client is connected to.
- **authType**: The `authType` parameter should be set to 3 for voucher code authentication.

 

3. Confirm the Login Credentials
- **Controller User**: If you're using the controller user for login, ensure that the username and password are correct and that the user has the necessary permissions to perform authentication operations.
- **Operator User**: Similarly, if you're using an operator user, verify the credentials and permissions.

 

4. Check the Omada Controller Configuration
- **External Portal Server Settings**: Ensure that the Omada Controller is correctly configured to use your external portal server. Check the settings in the Omada Controller's portal configuration section to make sure all the necessary details are correctly entered.
- **Voucher Code Settings**: Verify that the voucher code settings in the Omada Controller are configured to allow authentication via your external portal server.

 

5. Review the API Documentation
- The API documentation for the Omada Controller 5.0.15 or above can be found at [API and Code Sample for External Portal Server (Omada Controller 5.0.15 or above)](https://www.tp-link.com/us/support/faq/3231/). This document outlines the requirements and parameters for establishing an external portal server and provides code samples that you can refer to for guidance.
 

 

In the meantime, you may check the latest API documentation from this page:

 

Wish you a happy life and smooth network usage! 
  0  
  0  
#2
Options