node-unifiapi
node-unifiapi copied to clipboard
cloud access problems with 5.9 controller version
Hi Delian, first of all, thank you for your effort to create the scripts related unifi. Unfortunately Ubiquiti looks lazy to do that.
I can able to connect and send API commands via the cloud to my controllers which version is 5.6.22 but I have other two controllers with 5.9.29 version number and they don't work anymore. After some sniffing, it looks Ubiquiti was changed login URLs.
https://device-airos.svc.ubnt.com/api/airos/v1/unifi/turn/creds?username=xxx
That url doesn't show on my traffic logs when I accessing to 5.9.x controller from the web browser. Instead of I see this URL to authorize with OAuth mechanism.
https://sso.ubnt.com/oauth2/authorize?client_id=xx
To clarify the problem I added the debug log from your script. As I said, 5.6.x controllers in the same account and works properly with the same script.
Thanks in advance !
WssAPI Connected wss://device-airos.svc.ubnt.com/api/airos/v1/unifi/events +317ms WssAPI Message Sending: ping +0ms CloudAPI WebSocket is connected +2ms { request: { debugId: 2, uri: 'https://device-airos.svc.ubnt.com/api/airos/v1/unifi/turn/creds?username=X', method: 'GET', headers: { 'Content-type': 'application/json', Referer: 'https://account.ubnt.com/login?redirect=https%3A%2F%2Funifi.ubnt.com', Origin: 'https://account.ubnt.com', dnt: 1, host: 'device-airos.svc.ubnt.com', cookie: 'lithiumRest:ubnt=x; lithiumSSO:ubnt=x; NODEBB_AUTH=x; UBIC_AUTH=x' } } } WssAPI Message Received: pong +62ms { response: { debugId: 2, headers: { date: 'Thu, 27 Dec 2018 10:12:42 GMT', 'content-type': 'text/plain; charset=utf-8', 'content-length': '0', connection: 'close', 'access-control-allow-origin': 'https://account.ubnt.com', vary: 'Origin', 'access-control-allow-credentials': 'true', server: 'Cowboy', 'x-folgian-request-id': 'x', 'set-cookie': [Array] }, statusCode: 403, body: '' } } CloudAPI Error in opening webrtc +215ms