Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

Unable to connect. Wrong credentials Exception #45

Open
panipsilos opened this issue Jan 26, 2018 · 31 comments
Open

Unable to connect. Wrong credentials Exception #45

panipsilos opened this issue Jan 26, 2018 · 31 comments

Comments

@panipsilos
Copy link

Hi,

Is the library working? I am not able to connect to skype. I get wrong credentials exception. However, the credentials are correct.

@panipsilos panipsilos changed the title Unable to connect. Wrong credentials Unable to connect. Wrong credentials Exception Jan 26, 2018
@scoopex
Copy link

scoopex commented Jan 27, 2018

Same here :-)

An error occured while connecting...
java.io.IOException: Error thrown during connection. Check your credentials?
	at fr.delthas.skype.Skype.connect(Skype.java:164)
	at fr.delthas.skype.Skype.connect(Skype.java:124)
	at name.schoechlin.zabbix.skype.Bot.main(Bot.java:29)
Caused by: fr.delthas.skype.ParseException: org.json.JSONException: JSONObject["username"] not found.
	at fr.delthas.skype.WebConnector.updateUser(WebConnector.java:163)
	at fr.delthas.skype.WebConnector.updateContacts(WebConnector.java:89)
	at fr.delthas.skype.WebConnector.refreshTokens(WebConnector.java:43)
	at fr.delthas.skype.Skype.connect(Skype.java:157)
	... 2 more
Caused by: org.json.JSONException: JSONObject["username"] not found.
	at org.json.JSONObject.get(JSONObject.java:471)
	at org.json.JSONObject.getString(JSONObject.java:717)
	at fr.delthas.skype.WebConnector.updateUser(WebConnector.java:121)
	... 5 more

Double checked account credentials.
Tried to use mail address and skype-alias as login.

@hunghd60115
Copy link

hunghd60115 commented Jan 27, 2018

I have same issue

Login with my gmail, live:username... the same error return.

Error while connecting to Skype: Too many failed authentication attempts with given username or IP.

Please help me fix this issue.
I can login normal util today...

Note: checked account credentials by login Skype Web

@hunghd60115
Copy link

Dear @delthas,

More information about the problem:

Class Webconnector, method updateContacts()
Line 91 selfResponse return this
{"status":{"code":40000,"text":"Value of header 'Accept' has to be any from list '*/*, application/*, application/json'"}}

Do you have any idea about this?

Best Regards,

fabiodepin added a commit to fabiodepin/JavaSkype that referenced this issue Jan 31, 2018
d03n3rfr1tz3 added a commit to d03n3rfr1tz3/JavaSkype that referenced this issue Feb 26, 2018
d03n3rfr1tz3 added a commit to d03n3rfr1tz3/JavaSkype that referenced this issue Mar 4, 2018
@kdarrey
Copy link

kdarrey commented Mar 26, 2018

I still having the same problem. Had it been solved?

@Wani4ka
Copy link

Wani4ka commented Apr 10, 2018

up

@fabiodepin
Copy link

hello,
see my last commit, it's has been solved.
fabiodepin@c3d3cd2

@apovn
Copy link

apovn commented Jun 22, 2018

@fabiodepin I followed your fixing but it's not solved problem.
Did you fix this problem or use another solution ?

@metasonic
Copy link

Did anyone manage to find a fix for this issue?

@unnivm
Copy link

unnivm commented Jun 29, 2018

I am also getting the same error. Is there any solution for this issue?

@metasonic
Copy link

Still investigating, made it work for 1 out of 3 accounts, for the rest the issue is a 911 error. An issue for that was already added.
Will post some code snippets later today

@unnivm
Copy link

unnivm commented Jun 29, 2018

okay. thank you

@metasonic
Copy link

https://pastebin.com/cr68Quhy
With this changes, it works for 1 account, please note that this line is incorrect
if (command.equals("715")||command.equals("911")) { if 911 is received something is wrong

Also, the fact that we added userJSON.optJSONObject("profile"); as optional is wrong again but works as a hacky fix

haroflow pushed a commit to haroflow/JavaSkype that referenced this issue Jun 29, 2018
@haroflow
Copy link

I've got it working with an older Skype account, and two newer ones from Microsoft.

  • getSelfLiveUsername() functions were returning wrong live:usernames for some of my accounts. Apparently, when emails with same user for different domains are registered, Microsoft adds a number to the end of the live username, e.g: live:skype1_30. Changed to update the live username received on updateContacts(). This has solved all login problems I've encountered.
  • Added IDLE status to Presence. When left for some time, my skype sent this status to the server and exceptions were thrown, sometimes when logging in.
  • For one of my contacts the server did not return the "name" key on WebConnector:updateUser. Added a default value.

@metasonic
Copy link

@haroflow any chance you can share the code for getSelfLiveUsername() ?

fabiodepin added a commit to fabiodepin/JavaSkype that referenced this issue Jun 29, 2018
delthas#45 Solved login and contact listing problems. Added IDLE status.
@haroflow
Copy link

@metasonic You can find it here: fabiodepin@c14d2d7

@metasonic
Copy link

metasonic commented Jun 29, 2018

@haroflow issue still occurs if you use an old account, investigating the issue.
Really appreciate that you fixed the ms accounts issues though, amazing work!!

@metasonic
Copy link

no luck so far, not really sure what changed for old skype accounts. @delthas any chance you can point us in the right directions?

@haroflow
Copy link

@metasonic Thank you for the feedback!

My skype account is pretty old (+8 years). Not sure what could be happening with yours...
When I started on this I had different results logging in with either email or username. Have you tried both?

Any changes to the error messages? Could you post the stacktrace or the debug logs?

You may contact me on skype if you'd like, same username as here, we can debug this. :)

@delthas
Copy link
Owner

delthas commented Jun 30, 2018

@metasonic sorry, I don't really have time to really investigate this issue myself now.

@haroflow good points, when I added the Microsoft login support I kind of expected that the username wouldn't be the same if the user corresponding to the email was already registered, but I didn't have any account to investigate this.

Some pointers if you'd like to investigate this further:

Also you can join #msndevs in freenode where these libs and docs developers are (although not really active), one of the devs may have a custom Skype build that may help you with investigating how Skype works, ask if you need it. You can also run Miranda and use its debug logs to see what messages are sent and received.

@fabiodepin
Copy link

Hello,

1... the problem for this issue (#45 and #41) has been solved on commit fabiodepin/JavaSkype@c3d3cd2.

2... the problem recently mentioned by @metasonic has been reported on other issue: issue #30 (fr.delthas.skype.ParseException: Error message received: 911 2 CON 23).
And this second has been solved by @haroflow. My tests on my account with more than twenty years old, worked perfectly.
Good job @haroflow.

@metasonic please send your debugFile to pastebin and comment on issue #30 to we help you

@metasonic
Copy link

@delthas was looking for guidance on what where to look mostly, as based on https://github.com/msndevs/protocol-docs/wiki the auth process is correct. I started looking over Miranda logs, thanks a lot for this suggestion!!

@haroflow @fabiodepin amazing job on this one!

@fabiodepin are you planning on supporting this? I want to extend the notification capabilities of this to cover new things added to Skype and would love to contribute instead of creating a new fork

@apovn
Copy link

apovn commented Jul 14, 2018

Hi all
I found out that this app can login and send message successfully on my local machine Windows OS.
But when I upload it to my VPS (Ubuntu 16.0.4, x64), it raised errors:
java.io.IOException: Error while connecting to Live: refresh token not found.
and
java.io.IOException: Error thrown during connection. Check your credentials?
at fr.delthas.skype.Skype.connect(Skype.java:164)
at fr.delthas.skype.Skype.connect(Skype.java:124)

I debugged the code and see that the bug was caused in LiveConnector.java, this line:
Response post = Jsoup.connect(postUrl).data("PPFT", PPFT, "login", username, "passwd", password).cookie("MSPOK", MSPOK).maxBodySize(100 * 1024 * 1024).timeout(10000).method(Method.POST).followRedirects(false).ignoreContentType(true).ignoreHttpErrors(true).execute();

has error in return value.

I debugged and saw that:

  • In Linux OS (Ubuntu 16), return value of post.statusCode() is 200 => throw error above
  • In Windows OS, return value of post.statusCode() is 302 => success login => send msg successfully

I printed out my postUrl variable:

https://login.live.com/ppsecure/post.srf?client_id=00000000480BC46C&scope=service%3A%3Askype.com%3A%3AMBI_SSL&response_type=token&redirect_uri=https%3A%2F%2Flogin.live.com%2Foauth20_desktop.srf&state=999&locale=en&contextid=272DBD96F7CDC7C0&bk=1531600986&uaid=4ef892801b2a419097bc2a29c995100b&pid=15216
PPFT: DdhOTkhlbGjMhRSqF6ZK9qa44tAfkB85hMEnVM6FR4DL!MnNhuoFOLiDmhBlC5q1HYtuopG1eQ89*4MMuH417F5t12SVH2ANw7jYbt21zYHZBTKDpDHfuuBNddh00s406lYM1CEQq4KjLE!DuUDDC6PNSW!h2SWrQvicnfCgJoHGBUbPlGOCBwXX7jHjfXCG9*YLqdJ*UUOaszchqZhuhwc$

@delthas @fabiodepin @haroflow I appreciate your guidance. I've applied your code update but errors still occur. I read all threads but I still can't fix it. I really need this to be fixed.
Have you ever tested it in Ubuntu ? Have you encountered the same error at that line of code ?

Thanks

@apovn
Copy link

apovn commented Jul 16, 2018

Has anyone tested this app on Linux ? I bought a VPS (digital ocean) and run this app but it's not successful.
I'm using Microsoft account ( [email protected]) and it occurs error "java.io.IOException: Error thrown during connection. Check your credentials?" only in Linux OS ?

@metasonic
Copy link

@apovn have you tried on a local VM running Linux?
Just tried on a local VM running peppermint and it works.
You should try to login on a browser from that machine, as login may be blocked if MS security mechanism detects something suspicious. If I remember correctly, you should get an email in that case.

@apovn
Copy link

apovn commented Jul 17, 2018

@metasonic How can I try login on a browser on Ubuntu. I have VPS and connect to it via SSH and run command only. I feel this problem is really weird.

@apovn
Copy link

apovn commented Jul 18, 2018

@metasonic I tested on local machine (Ubuntu OS) but it's not success. Could you send me the source code that you run successfully on peppermint. My email tritranducATgmail.com.

@apovn
Copy link

apovn commented Jul 23, 2018

Hi @delthas, can you help me this problem ?

Do you know why this line of code in LiveConnector.java, refreshTokens() method:
Jsoup.connect(postUrl).data("PPFT", PPFT, "login", username, "passwd", password).cookie("MSPOK", MSPOK).maxBodySize(100 * 1024 * 1024).timeout(10000).method(Method.POST).followRedirects(false).ignoreContentType(true).ignoreHttpErrors(true).execute();

always return statusCode = 200 on Linux (Ubuntu) and in this case post.header("Location") will return null. So that in Ubuntu app can not get refreshToken.
I expect statusCode=302, not 200.

Do I have to config anything more in Ubuntu ?

Anyone know about this case ? I appreciate your help.

@haroflow
Copy link

@apovn
We've been testing this on Debian (an old version) and Mint 18 (based on 16.04.1-Ubuntu), and it's working fine... I'll contact you via e-mail.

@apovn
Copy link

apovn commented Jul 23, 2018

@haroflow Thank you.

@Akitha
Copy link

Akitha commented Nov 6, 2018

Same here :-)

An error occured while connecting...
java.io.IOException: Error thrown during connection. Check your credentials?
	at fr.delthas.skype.Skype.connect(Skype.java:164)
	at fr.delthas.skype.Skype.connect(Skype.java:124)
	at name.schoechlin.zabbix.skype.Bot.main(Bot.java:29)
Caused by: fr.delthas.skype.ParseException: org.json.JSONException: JSONObject["username"] not found.
	at fr.delthas.skype.WebConnector.updateUser(WebConnector.java:163)
	at fr.delthas.skype.WebConnector.updateContacts(WebConnector.java:89)
	at fr.delthas.skype.WebConnector.refreshTokens(WebConnector.java:43)
	at fr.delthas.skype.Skype.connect(Skype.java:157)
	... 2 more
Caused by: org.json.JSONException: JSONObject["username"] not found.
	at org.json.JSONObject.get(JSONObject.java:471)
	at org.json.JSONObject.getString(JSONObject.java:717)
	at fr.delthas.skype.WebConnector.updateUser(WebConnector.java:121)
	... 5 more

Double checked account credentials.
Tried to use mail address and skype-alias as login.

Did you get fixed this because I got the same Error

@Akitha
Copy link

Akitha commented Nov 6, 2018

Anyone Got fixed or Does this still works ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests