Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-85265

[OAuth] form percent encoding problem with Google

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.14.2
    • None

    Description

      Heads up: Using Google OAuth2, if the user logging in is a member of the GSuite that owns the project, everything is fine. If a non-member user logs in, Google, for some reason sends the exactly correct data, but with the variable contents url-encoded with percent notation. (A Google bug?)

      For example, instead of the "scope" key being "email https://www.googleapis.com/auth/userinfo.email openid" it's sent as

      "email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+openid"

      All of the values are like this, and if left that way, the next step in the flow causes a "bad request" error. In order to fix it, I had to modify QOAuthHttpServerReplyHandlerPrivate::_q_answerClient

      I inserted a fix into the for loop iterating the reply just before emitting the callback signal:

      receivedData.insert(it->first, QUrl::fromPercentEncoding(it->second.toLatin1());

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vuokko Juha Vuolle
            stsdeveloper Application Developer
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes