Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.14.2
-
None
-
-
5
-
Foundation Sprint 106
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());