diff options
author | ikeblaster <ike@thez.info> | 2021-08-28 15:40:33 +0200 |
---|---|---|
committer | ikeblaster <ike@thez.info> | 2021-08-28 15:40:33 +0200 |
commit | bc9c084e1214b800b403a481210dd3f492c340e8 (patch) | |
tree | 3aaeca2915be9e83ac43b4a6731cbe5cf6da162b /protocols/SkypeWeb | |
parent | 466f6fdabed3914a1cf07f9b2e2ec845422477b6 (diff) |
fixes #2946 (Skype: cannot login)
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/requests/oauth.h | 8 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_oauth.cpp | 11 |
2 files changed, 11 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/requests/oauth.h b/protocols/SkypeWeb/src/requests/oauth.h index dc579a238f..efd43fc81f 100644 --- a/protocols/SkypeWeb/src/requests/oauth.h +++ b/protocols/SkypeWeb/src/requests/oauth.h @@ -52,14 +52,16 @@ struct OAuthRequest : public AsyncHttpRequest { this << CHAR_PARAM("wa", "wsignin1.0") << CHAR_PARAM("wp", "MBI_SSL") << CHAR_PARAM("wreply", "https://lw.skype.com/login/oauth/proxy?site_name=lw.skype.com") - << CHAR_PARAM("cobrandid", "90010"); + << CHAR_PARAM("cobrandid", "90010") + << CHAR_PARAM("id", "293290") + << CHAR_PARAM("opid", opid); + m_szUrl.AppendFormat("?%s", m_szParam.c_str()); m_szParam.Empty(); AddHeader("Cookie", cookies); - this << CHAR_PARAM("type", "28") << CHAR_PARAM("PPFT", ppft) << CHAR_PARAM("opid", opid) << CHAR_PARAM("site_name", "lw.skype.com&") - << INT_PARAM("oauthPartner", 999) << INT_PARAM("client_id", 578134) << CHAR_PARAM("redirect_uri", "https://web.skype.com"); + this << CHAR_PARAM("type", "28") << CHAR_PARAM("PPFT", ppft); } OAuthRequest(const char *t) : diff --git a/protocols/SkypeWeb/src/skype_oauth.cpp b/protocols/SkypeWeb/src/skype_oauth.cpp index a0605346d3..9a9e25df3c 100644 --- a/protocols/SkypeWeb/src/skype_oauth.cpp +++ b/protocols/SkypeWeb/src/skype_oauth.cpp @@ -50,11 +50,12 @@ void CSkypeProto::OnOAuthStart(NETLIBHTTPREQUEST *response, AsyncHttpRequest*) std::string PPFT = match[1]; std::map<std::string, std::string> scookies; + regex = "^(.+?)=(.*?);"; + for (int i = 0; i < response->headersCount; i++) { if (mir_strcmpi(response->headers[i].szName, "Set-Cookie")) continue; - regex = "^(.+?)=(.+?);"; content = response->headers[i].szValue; if (std::regex_search(content, match, regex)) scookies[match[1]] = match[2]; @@ -102,19 +103,19 @@ void CSkypeProto::OnOAuthConfirm(NETLIBHTTPREQUEST *response, AsyncHttpRequest * return; } - std::regex regex("^(.+?)=(.+?);"); + std::regex regex("^(.+?=.*?;)"); std::smatch match; - std::map<std::string, std::string> scookies; + CMStringA mscookies; + for (int i = 0; i < response->headersCount; i++) { if (mir_strcmpi(response->headers[i].szName, "Set-Cookie")) continue; content = response->headers[i].szValue; if (std::regex_search(content, match, regex)) - scookies[match[1]] = match[2]; + mscookies.Append(match[1].str().c_str()); } - CMStringA mscookies(FORMAT, "MSPRequ=%s;MSPOK=%s;PPAuth=%s;OParams=%s;", cookies["MSPRequ"].c_str(), scookies["MSPOK"].c_str(), scookies["PPAuth"].c_str(), scookies["OParams"].c_str()); PushRequest(new OAuthRequest(mscookies.c_str(), PPFT.c_str(), opid.c_str())); } |