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

OAuth2 form percent encoding problem with Google

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Windows

      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

            Assignee:
            jefernan Jesus Fernandez
            Reporter:
            stsdeveloper Application Developer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes