Remotely authorizing guest through the API

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.

Remotely authorizing guest through the API

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
Remotely authorizing guest through the API
Remotely authorizing guest through the API
2022-05-02 00:23:40
Model: AC50  
Hardware Version: V5
Firmware Version:

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:

  1. apMac: "B4-B0-24-82-77-12"
  2. authType: 4
  3. clientMac: "82-CA-23-E5-FC-82"
  4. radioId: 0
  5. ssidName: "Test-Omada"
  6. time: 120000

 

Is there anything I missed? Hope someone can help me with this. Thank you.

  0      
  0      
#1
Options
5 Reply
Re:Remotely authorizing guest through the API
2022-05-02 11:58:05

  @drawpaint 

 

What about the version of your controller?

Hardware or software?

More details may help to locate the issue.

The screenshot of the settings and error message are all good.

Just striving to develop myself while helping others.
  0  
  0  
#2
Options
Re:Remotely authorizing guest through the API
2022-05-02 14:54:00

 

Virgo wrote

  @drawpaint 

 

What about the version of your controller?

Hardware or software?

More details may help to locate the issue.

The screenshot of the settings and error message are all good.

 

@Virgo 

 

Thanks for responding. I am using  the software Controller Version: 5.1.7. This is installed on a Ubuntu 16.04.3 LTS server. 

 

I have another server running NGINX, and PHP, that serves as an external portal for guests. Ultimate goal is for guests to login to this portal, get their mac address and send an authorization post to the OMADA controller on the previous server above. As of now, I just created an omada_test.php file which contains the functions posted in this tutorial (https://www.tp-link.com/ph/support/faq/3231/). Below is the screenshot of the error. As you can see loggin in to the controller via API was successful. But failed in the authentication call.

 

  0  
  0  
#3
Options
Re:Remotely authorizing guest through the API
2022-05-05 13:01:31

Anyone from the community or from TPLINK guys? Please I need your help.

  0  
  0  
#4
Options
Re:Remotely authorizing guest through the API
2022-05-06 06:45:03

Dear @drawpaint ,

 

drawpaint wrote

Thanks for responding. I am using  the software Controller Version: 5.1.7. This is installed on a Ubuntu 16.04.3 LTS server. 

I have another server running NGINX, and PHP, that serves as an external portal for guests. Ultimate goal is for guests to login to this portal, get their mac address and send an authorization post to the OMADA controller on the previous server above. As of now, I just created an omada_test.php file which contains the functions posted in this tutorial (https://www.tp-link.com/ph/support/faq/3231/). Below is the screenshot of the error. As you can see loggin in to the controller via API was successful. But failed in the authentication call.

 

It is suggestion to try it again by following V5 API, please refer to this link to get it:

https://community.tp-link.com/en/business/forum/topic/253944?page=3

 

 

Best Regards!

Best Regards! >> Omada EAP Firmware Trial Available Here << >> Get the Latest Omada SDN Controller Releases Here << *Try filtering posts on each forum by Label of [Early Access]*
  0  
  0  
#5
Options
Re:Remotely authorizing guest through the API
2022-06-06 07:04:44

  @drawpaint did you find any solution? I have the same problem

  0  
  0  
#6
Options