Not sure if I'm posting this correctly didn't see how to associate it with the Beta which issues are expected....
Problem / Bug overall is not able to receive event notifications. I will post a support request with my code looking for advice as I may not interacting with node-arlo correctly however by inspection I found a few issues the below being one
In the Beta branch client.js uses the default PersonalAccessTokenCredentialHandler implementation
{ PersonalAccessTokenCredentialHandler } from 'typed-rest-client/Handlers';
Arlo is expecting the the raw token returned from the login.
The PersonalAccessTokenCredentialHandler implements prepareRequest as:
Arlo API is not expecting the token to have 'Basic ' as a prefix nor have it be base64 encoded. The work around I choose to allow me to try and get further with being able to receive notification was to override the prepareRequest function after in the client constructor adding the line
this.handler.prepareRequest = function (options) { options.headers['Authorization'] = this.token; options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; }.bind(this.handler);
client.js in Beta branch with above override of prepareRequest
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Not sure if I'm posting this correctly didn't see how to associate it with the Beta which issues are expected.... Problem / Bug overall is not able to receive event notifications. I will post a support request with my code looking for advice as I may not interacting with node-arlo correctly however by inspection I found a few issues the below being one
In the Beta branch client.js uses the default PersonalAccessTokenCredentialHandler implementation { PersonalAccessTokenCredentialHandler } from 'typed-rest-client/Handlers'; Arlo is expecting the the raw token returned from the login. The PersonalAccessTokenCredentialHandler implements prepareRequest as:
prepareRequest(options) { options.headers['Authorization'] =
Basic ${Buffer.from(PAT:${this.token}
).toString('base64')}; options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; }
Arlo API is not expecting the token to have 'Basic ' as a prefix nor have it be base64 encoded. The work around I choose to allow me to try and get further with being able to receive notification was to override the prepareRequest function after in the client constructor adding the line
this.handler.prepareRequest = function (options) { options.headers['Authorization'] = this.token; options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; }.bind(this.handler);
client.js in Beta branch with above override of prepareRequest` constructor(userAgent = 'node-arlo', baseUrl = 'https://arlo.netgear.com/hmsweb') { this.userAgent = userAgent; this.baseUrl = baseUrl; /**