Unsolved Google OAuth2 from desktop app
-
I want to try Google Login from desktop. windows & linux. Tried a source from http://blog.qt.io/blog/2017/01/25/connecting-qt-application-google-services-using-oauth-2-0/
It shows google sign-in page, and when we give credentials the debug o/p window shows a log like this:TemporaryCredentialsReceived status QOAuthOobReplyHandler::networkReplyFinished: Error transferring https://accounts.google.com/o/oauth2/token - server replied: Bad Request
If I try set-scope(email) and grant() again, it will work nicely. whenever i logout from the google page and retry, the 1st attempt shows this error. please help.
-
I'm facing the same problem. The steps provided in the above mentioned Qt blog post aren't detailed enough to get OAuth2 working, and the Qt Reddit example doesn't adapt easily to the Google case. If Qt folks are watching, please some help here would be appreciated. I'm trying to use OAuth2 to access Google Drive.
-
@veenusav I have the same issue with Qt 5.9.1 on windows.
-
You have to URL-decode the login code that Google sends you. Basically, install a parameter modifier before you launch the first request. Otherwise, Google will not recognize the code that they send you, because it contains URL-encoded characters. More details in this post on how to authenticate a Qt app with Google SSO.
Hope it helps!