REST API Authorization

neogeo

Member
Hi,

i'm using flashphoner version 5.0.2484 and i have implemented the REST API for authorization based on docs from here https://flashphoner.com/docs/wcs5/wcs_docs/html/en/wcs-rest-methods/. My authorization scheme consists of an "auth" tag inside "custom" variable which contains a token (ex. custom: { auth: "xxxxxxxxxx" } ) .

It was working great at the implementation time (before 10-12 months ago), but testing it now it seems to not work.
Specifically when i return 404 and 500 error's in my custom playstream endpoint seems to allow user to watch the stream.

Can you please advise?


Regards
 

Max

Administrator
Staff member
Please verify that
- 'appKey' of the appropriate application is passed to createSession(), if custom application is used
- URL of the application being used is configured
Log in to CLI
Code:
ssh -p 2000 admin@localhost
See the current applications
Code:
show apps
The functionality does work with v. 2484 and the latest v. 2601.
E.g.,
1. 'auth' is passed when connection session is created
Code:
Flashphoner.createSession({urlServer: url, custom:{auth: "12345"}})
2. There is 'auth' in 'connect' request (can be seen in WCS_HOME/logs/flashphoner_manager.log)
Code:
URL:http://host/rest/my_api/connect
OBJECT:
{
…..
  "appKey" : "defaultApp",
…..
  "custom" : {
    "auth" : "12345"
  },
….
}
3. 'custom[auth]' parameter is checked in a script on web server to which URL configured for the application (e.g., "defaultApp") points; and connection can be forbidden
 

Max

Administrator
Staff member
return 404 or 500 from my REST API to flashphoner media server
Please clarify – return for 'connect' method? Does WCS receive the responses?
Network traffic dump can be checked, e.g. send request via HTTP and if WCS and web server are on the same server
Code:
tcpdump -i lo -w dump.pcap
Attached is a working API example for 'connect' method.
 

Attachments

Top