Remotely authorizing guest through the API
Greetings!
I have an external portal that will authorize guests through the API. I have followed the instructions here(https://www.tp-link.com/ph/support/faq/3231/) but still unsuccessful.
I can login successfully with the return message below:
{errorCode: 0, msg: 'Hotspot log in successfully.', result: {…}}
But I got an {"errorCode":-41501,"msg":"Failed to authenticate."} when calling the authorize function.
I tried two methods for the authorize url:
1. curl_setopt($ch, CURLOPT_URL, "https://" . $CONTROLLER . ":" . $PORT . "/" . $CONTROLLER_ID . "/api/v2/hotspot/extPortal/auth");
and with the token
2. curl_setopt($ch, CURLOPT_URL, "https://" . $CONTROLLER . ":" . $PORT . "/" . $CONTROLLER_ID . "/api/v2/hotspot/extPortal/auth?token=".$csrfToken);
These are the $authinfo:
- apMac: "B4-B0-24-82-77-12"
- authType: 4
- clientMac: "82-CA-23-E5-FC-82"
- radioId: 0
- ssidName: "Test-Omada"
- time: 120000
Is there anything I missed? Hope someone can help me with this. Thank you.