Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Google OAuth2 from desktop app
Qt 6.11 is out! See what's new in the release blog

Google OAuth2 from desktop app

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • veenusavV Offline
    veenusavV Offline
    veenusav
    wrote on last edited by veenusav
    #1

    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.

    M 1 Reply Last reply
    1
    • M Offline
      M Offline
      mjsmithers
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      1
      • veenusavV veenusav

        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.

        M Offline
        M Offline
        Mostafa88
        wrote on last edited by
        #3

        @veenusav I have the same issue with Qt 5.9.1 on windows.

        Changing one parameter cannot fix totallity of system. Do small move at once.

        1 Reply Last reply
        0
        • I Offline
          I Offline
          ihaveajob
          wrote on last edited by
          #4

          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!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved