invalid network proxy setting for oauth2
Bug #1237869 reported by
Wu Shu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
signon-plugin-oauth2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
1. I'm behind a company proxy, which only accept HTTP, HTTPS, FTP proxy settings. I've already have those set correctly.
2. When I tried to add Google online account, I can get into Google's login and authorization page. But after I click "Accept", the page becomes blank and no further action will be taken. No matter how long you wait or just cancel it, the account cannot be added.
I've root caused the issue and will update it below.
Can you folks take a look if it makes senses?
To post a comment you must log in.
Forgot to mention, this issue also affects Twitter online account. I can only get a blank page when I chose to add the Twitter account, without no any prompt/warnings.
My Analysis
----------------
1. I change loglevel of signond.conf and see the following from log:
Oct 10 10:46:01 kitt signonpluginpro cess: plugin.cpp 126 userActionFinished : cess: oauth2plugin.cpp 310 userActionFinished : cess: oauth2plugin.cpp 323 userActionFinished : "https:/ /wiki.ubuntu. com/?code= 4/PMaxsE1yzBrsz LJyMbF0gyYhX_ Sx.ouuTe7vG4m0X Enp6UAPFm0EAeYd AgwI" cess: oauth2plugin.cpp 566 sendOAuth2PostR equest : cess: oauth2plugin.cpp 575 sendOAuth2PostR equest : Query string = "grant_ type=authorizat ion_code& client_ id=759250720802 -4sii0me9963n9f dqdmi7cepn6ub8l uoh.apps. googleuserconte nt.com& client_ secret= juFngKUcuhB7IRQ qHtSLavqJ& code=4/ PMaxsE1yzBrszLJ yMbF0gyYhX_ Sx.ouuTe7vG4m0X Enp6UAPFm0EAeYd AgwI&redirect_ uri=https:/ /wiki.ubuntu. com/" cess: ../../. ./../src/ remotepluginpro cess/remoteplug inprocess. cpp 496 startTask operation is completed
Oct 10 10:46:01 kitt signonpluginpro
Oct 10 10:46:01 kitt signonpluginpro
Oct 10 10:46:01 kitt signonpluginpro
Oct 10 10:46:01 kitt signonpluginpro
Oct 10 10:46:01 kitt signonpluginpro
After quite a whie:
Oct 10 10:51:06 kitt signonpluginpro cess: base-plugin.cpp 151 handleNetworkError : error signal received: 99 cess: ../../. ./../src/ remotepluginpro cess/remoteplug inprocess. cpp 425 disableCancelThread Before the isFinished loop cess: ../../. ./../src/ remotepluginpro cess/remoteplug inprocess. cpp 430 disableCancelThread Internal iteration 0 cess: ../../. ./../src/ remotepluginpro cess/remoteplug inprocess. cpp 249 error error is sent 307 "Connection to proxy closed prematurely" cess: base-plugin.cpp 133 onPostFinished : Finished signal received
Oct 10 10:51:06 kitt signonpluginpro
Oct 10 10:51:06 kitt signonpluginpro
Oct 10 10:51:06 kitt signonpluginpro
Oct 10 10:51:06 kitt signonpluginpro
So it appears the proxy isn't correctly used. But I did set the proxy correctly and the previous steps can go on well. Also I can succeed in adding Facebook account.
2. I added some logging in plugin.cpp and oauth2plugin.cpp and found the proxy in the QNetworkAccessM anager is correctly: com:3128. So it's really strange the connection cannot reach when proxy is correctly set. I tried to use Wireshark to see what happened but it's HTTPS so it's difficulty to do.
proxy.foobar.
3. Then I accidentally commented the line in plugin.cpp: :process( const SignOn::SessionData &inData, ...) networkAccessMa nager-> setProxy( networkProxy) ; >setNetworkAcce ssManager( m_networkAccess Manager) ;
void Plugin:
{
...
//m_
impl-
...
}
And found it worked! Both Google account and Twitter account are added.
4. From my experiences, I believe it's due to HTTPS over HTTP proxy. In my company HTTPS should go to HTTPS proxy (https:/ /proxy. foobar. com:3128).
From the code in Plugin::process, the proxy is set to QNetworkProxy: :applicationPro xy():
QNetworkProxy networkProxy = QNetworkProxy: :applicationPro xy(); cessManager- >setProxy( networkProxy) ; >setNetworkAcce ssManager( m_networkAccess Manager) ;
m_networkAc
impl-
applicationProxy() will only return the HTTP proxy when the system p...