summaryrefslogtreecommitdiffstats
path: root/src/oauth/qoauthhttpserverreplyhandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v6.5.7-lts' into tqtc/lts-6.5-opensourcev6.5.7-lts-lgplTarja Sundqvist2025-10-091-6/+15
|\ | | | | | | | | | | | | | | | | | | Qt 6.5.7-lts release Conflicts solved: dependencies.yaml src/oauth/qabstractoauth.cpp Change-Id: If85eac30d0ca25fb7cefcea4d14f3ffa9ab95c24
| * Cache callback value / redirect_uri for later useJuha Vuolle2024-05-241-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to 'RFC 8252 Section 8.3' the loopback listening should be closed after receiving authorization response. There were however two things preventing application developers from doing this: 1) The callback (aka redirect_uri) is needed in the subsequent access token request (note: listening is not needed anymore). 2) The callback (aka redirect_uri) is currently used also in refresh token request (this is unnecessary though, and should be removed in a follow-up commit). But the problem for these two was that the QOAuthHttpServerReplyHandler::callback() code asserted (debug) or just returned a wrong value (release) if the handler wasn't listening. This made it unfeasible to close the handler in a timely manner. With this commit the callback/redirect_uri is cached, and consequently the handler can be closed immediately after authorization. Pick-to: 6.2 Fixes: QTBUG-124333 Change-Id: I063637029908ed4fa0390a0cb07511c92bd51874 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 67b2aec9dd987fc4ea0a7c817639b36380ccaf80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 649288461116e5dfe7a13bdb07bd5fb61b245e5f)
* | Revert "Update commercial SPDX-License-Identifier"Tarja Sundqvist2025-01-031-1/+1
|/ | | | | | | | | | This reverts commit b2464fb31554e7d44e7a28e920c89240ad8f2312. Revert of commercial SPDX license identifiers is required for the Qt 6.5.x opensource releases, Qt 6.5.4 onwards. Change-Id: I017fd7dfcff99904a43aee53bd736c156024217f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update commercial SPDX-License-IdentifierTarja Sundqvist2023-11-141-1/+1
| | | | | | | | | | Updated the commercial SPDX-License-Identifier to the files in tqtc-qtnetworkauth. Examples, tests, or documentation files are not updated. Task-number: QTQAINFRA-5900 Change-Id: I5dcb68f58fbfa3799df2d153bd7ff483d55113ef Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-161-28/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ic012e87171ed4cef6871eff7d76f56994ea3ca1f Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* wasm: Work around compilation failures when FEATURE_http=OFFAlexandru Croitor2021-04-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | Some of the header and source files incorrectly check for QT_NO_HTTP without including the necessary QtNetwork/qtnetwork-config.h header. Because CMake's AUTOGEN still runs moc on those files and then includes them into mocs_compilation.cpp, this causes compilation failures. Work around the compilation failures by including the moc files directly in the respective cpp files. Note that this ensures archiving works in a static build, but results in a an unusable library. This was the case for Qt 5.15 as well. A follow up change will be done to clean up this state, but for now this change unblocks adding the WebAssembly platform into CI. Task-number: QTBUG-78647 Task-number: QTBUG-93243 Change-Id: I9b6657d5ae539fdb09a741637cc5a19e652c9272 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Http reply handler: various clean-upMårten Nordheim2020-11-021-5/+11
| | | | | | | | | | | | | Just various changes I noticed could be made while I was looking into a bugreport. The socket->read(1) creates a QByteArray each time, let's just read one char. Use QByteArray::number instead of QString::number().toUtf8 Change-Id: I0c508fee0c350a76fc9e0d6ea6db5379a4075ab1 Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* Silence warning about deprecated codeAndy Shaw2020-06-221-1/+1
| | | | | Change-Id: I69b2e29b47144b5c72ea3828840bbd5d01ea7c37 Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* Use 127.0.0.1 for redirect URISamuel Gaist2018-11-221-2/+2
| | | | | | | | | | | | | Following section 8.3 of RFC 8252 (https://tools.ietf.org/html/rfc8252#section-8.3), it is specifically not recommended to use localhost but 127.0.0.1. This patch fixes that. [ChangeLog][General] Use 127.0.0.1 in place of localhost for redirect URI following RFC 8252. Fixes: QTBUG-67528 Change-Id: I6f5a8dd26134cde2373185eaf2c8853d6f500e98 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix compilation when QT_NO_HTTP is definedv5.12.0-beta4v5.12.0-beta3v5.12.0-beta2Eskil Abrahamsen Blomfeldt2018-10-091-0/+2
| | | | | | | | The feature macros are defined in a header, so it has to be included first. Change-Id: I3ed7c4978cb9cdde23ed37d0e963a24a6b07f335 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Move logging category to private headerv5.10.0-beta1Friedemann Kleint2017-09-261-0/+1
| | | | | | | | | | | Logging categories are not public API and throw off qdoc, causing: qtnetworkauth/src/oauth/qabstractoauth.cpp:492: warning: Can't link to 'QAbstractOAuthReplyHandler' Amends 43634a54376c55ff78521ea9a063f4cab984d871. Change-Id: I730a39f14ee93d63a5d37271a79ea75b022e3ec5 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-221-3/+3
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/oauth/qabstractoauth.cpp tests/auto/oauth1/tst_oauth1.cpp Done-with: Jesus Fernandez<jesus.fernandez@qt.io> Change-Id: I5be2c6ad2cd00943ee3acafe5b5c693fc4ada03c
| * Bump copyright yearJesus Fernandez2017-07-121-1/+1
| | | | | | | | | | Change-Id: Iaad9fb2096cd01a762c3eace90c6154b0d0ebe59 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Replace std::bind with lambdasThiago Macieira2017-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They don't compile with Clang 5.0 + libstdc++ from GCC 7. I didn't care to investigate why. functional:841:7: error: static_assert failed "Wrong number of arguments for pointer-to-member" [...] qoauth2authorizationcodeflow.cpp:340:13: note: while substituting deduced template arguments into function template 'bind' [with _Func = void (QAbstractOAuthReplyHandler::*)(QNetworkReply *), _BoundArgs = <QAbstractOAuthReplyHandler *, QNetworkReply *>] Change-Id: Ia53158e207a94bf49489fffd14c791ec1aaa707d Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Use QLoggingCategory in QtNetworkAuthJesus Fernandez2017-06-201-14/+10
|/ | | | | | | | It allows filtering the debug messages in runtime using the QLoggingCategory system. Change-Id: Ib6790455ad856ccbc20e34f0a84a07cf5240f62e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Let the users change the path for the callback-url5.8Mårten Nordheim2017-04-101-2/+20
| | | | | | Task-number: QTBUG-59653 Change-Id: I4bf938db2db3624c37b7f1a8d598bfa43052e2e0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix HTML response when using multibyte charactersJesus Fernandez2017-03-291-6/+6
| | | | | | | | | | | | | | Report correct Content-Length even when multibyte characters are passed to the QOAuthHttpServerReplyHandler::setCallbackText() function. Previously the length of a QString was used, that would be less than the length of the UTF-8 encoding of it that was the actual content. Task-number: QTBUG-59725 Change-Id: I1536b636027f81bb234969051a8fc9d88e506f8c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Modify licensev5.8.0-rc1v5.8.0Jesus Fernandez2016-12-071-16/+6
| | | | | | | Change-Id: I40cc53ee24ad71a1293dc3b635b2cb545d29a686 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Tuukka Turunen <tuukka.turunen@theqtcompany.com> Reviewed-by: Fredrik de Vibe <fredrik.devibe@qt.io>
* Integration fixJesus Fernandez2016-08-221-1/+1
| | | | | | | | | Variable initialization to avoid clang complains. The OAuth1 is marked as insignificant because it uses an external server. This test needs a rewrite. Change-Id: I195bf955414ccff04b7d262249e869bec7059531 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* OAuth supportJesus Fernandez2016-08-191-0/+329
New library to support OAuth1 and OAuth2 standard in Qt. OAuth provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end-user). It also provides a process for end-users to authorize third-party access to their server resources without sharing their credentials (typically, a username and password pair), using user-agent redirections. [ChangeLog][OAuth] Added OAuth support Change-Id: I3971456f93bf6ddd7fd46f555202bab2eb777c15 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>