Comments (5)
Thank you for your report.
I wasn't able to reproduce the issue (so at least it's not a global problem).
Could you tell me more about how the error happened? Are you using authentication with simple credentials (skype login and password)? Is it a temporary error? Is it a new error (were you able to connect to Skype before)?
from skype-http.
Since he is using https://github.com/matrix-hacks/matrix-puppet-skype I can answser a bit: (I am unable to reproduce his issue, too, and told him to make an issue here, since it appears to be within the skype-http library itself)
This is authenticating using username / password,
skypehttp.connect({
credentials: {
username: "blah",
password: "blah"
},
verbose: true
})
https://github.com/matrix-hacks/matrix-puppet-skype/blob/master/client.js#L37
from skype-http.
Thank you.
I would have expected a 403 error to happen earlier during the login process. When the error happens, the user is already logged (as the logs show it) but is forbidden to register an endpoint for polling. Registration allows to later query new events.
I'd like you to try a few things.
Here is the JS version of subscribeToResources
(in dist/lib-est2015/lib/login.js
):
function subscribeToResources(ioOptions, registrationToken) {
return __awaiter(this, void 0, void 0, function* () {
// TODO(demurgos): typedef
// tslint:disable-next-line:typedef
const requestDocument = {
interestedResources: [
"/v1/threads/ALL",
"/v1/users/ME/contacts/ALL",
"/v1/users/ME/conversations/ALL/messages",
"/v1/users/ME/conversations/ALL/properties",
],
template: "raw",
channelType: "httpLongPoll",
};
const requestOptions = {
uri: messagesUri.subscriptions(registrationToken.host),
cookies: ioOptions.cookies,
body: JSON.stringify(requestDocument),
headers: {
RegistrationToken: registrationToken.raw,
},
};
const res = yield ioOptions.io.post(requestOptions);
if (res.statusCode !== 201) {
return Promise.reject(new incident_1.Incident("net", `Unable to subscribe to resources: statusCode: ${res.statusCode} body: ${res.body}`));
}
// Example response:
// {
// "statusCode": 201,
// "body": "{}",
// "headers": {
// "cache-control": "no-store, must-revalidate, no-cache",
// "pragma": "no-cache",
// "content-length": "2",
// "content-type": "application/json; charset=utf-8",
// "location": "https://db5-client-s.gateway.messenger.live.com/v1/users/ME/endpoints/SELF/subscriptions/0",
// "x-content-type-options": "nosniff",
// "contextid": "tcid=3434983151221922702,server=DB5SCH101121535",
// "date": "Sat, 14 May 2016 16:41:17 GMT",
// "connection": "close"
// }
// }
});
}
-
Replace
interestedResources
by an empty array. If you get a 403 even with an empty array, we'll have to investigate further. If the request succeeds, try each resource individually to find the one which causes the error. -
Instead of emitting
res.body
in the error, please log the headers (JSON.stringify(res.headers)
).
from skype-http.
function subscribeToResources(ioOptions, registrationToken) {
return __awaiter(this, void 0, void 0, function* () {
// TODO(demurgos): typedef
// tslint:disable-next-line:typedef
const requestDocument = {
interestedResources: [
// "/v1/threads/ALL",
// "/v1/users/ME/contacts/ALL",
// "/v1/users/ME/conversations/ALL/messages",
// "/v1/users/ME/conversations/ALL/properties",
],
template: "raw",
channelType: "httpLongPoll",
};
const requestOptions = {
uri: messagesUri.subscriptions(registrationToken.host),
cookies: ioOptions.cookies,
body: JSON.stringify(requestDocument),
headers: {
RegistrationToken: registrationToken.raw,
},
};
I hope I understand correctly. I did so. and got the same error as in the beginning
from skype-http.
Thank you, that's what I had in mind.
Since you still get a 403 error, it means that the issue was not with a particular resource but the whole registration process. I guess that the official web application works for you? (this library acts as an alternate client mimicking the web application). If it works, I'd need some logs to compare which HTTP requests the web app performs for you. I'll take some time this evening to test it myself and tell you what I need exactly.
from skype-http.
Related Issues (20)
- Unable to login with MicrosoftAccount HOT 3
- Image sending bug HOT 3
- lots of ECONNRESET issues HOT 5
- Sending formatted text HOT 1
- Skype for business
- Not compatible with typescript 3
- Add to contact
- An in-range update of @types/request is breaking the build 🚨 HOT 1
- can't get display name of bots
- Unable to login with MicrosoftAccount HOT 3
- acceptContactRequest URI changed?
- skpy.core.SkypeAuthException: Token file has expired
- skpy.core.SkypeAuthException: Token file has expired HOT 1
- Unable to login with MicrosoftAccount HOT 2
- #t -> #ipt; own profile can not be obtained. HOT 1
- Two-factor authentication
- How to log users who join and leave Group chat calls?
- MicrosoftAccountLogin: Unable to login with MicrosoftAccount. caused by GetLiveToken
- getContacts returns only a dozen contacts HOT 1
- How to create a Skype-only live account? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skype-http.