summaryrefslogtreecommitdiffstats
path: root/src/oauth/qoauth2authorizationcodeflow.h
Commit message (Collapse)AuthorAgeFilesLines
* Make refreshAccessToken() a regular deprecation without Qt 7 removalJuha Vuolle2025-01-161-1/+2
| | | | | | | | | | | | | | | Qt 6.9 introduces common baseclass method, refreshTokens() whose implementation can be overridden by classes. Marking the refreshAccessToken() as deprecated, and not automatically removing it, is adequate and minimizes user impact. Found in API review. Amends 2b1e3419c5ef43e964f40dbe79d7a7da0de5aa57 Pick-to: 6.9 Change-Id: I67fa85a4225500d5fc0fcb882e3fc90a5c63913f Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Use refreshTokens() as an NVI already in Qt 6Juha Vuolle2025-01-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This allows having a common baseclass method for refreshing tokens already in Qt 6. This should minimize the user impact of removing the leaf class "refreshAccessToken()" function in Qt 7. Furthermore this simplifies the automatic token refresh implementation, which is implemented at the common baseclass level; the implementation can inokve/call the refreshTokens() directly, as opposed to the leaf class connecting to the accessTokenAboutToExpire() signal. Lastly this allows removing the (new in Qt 6.9) "QOAuth2DeviceAuthorizationFlow::refresAccessTokens()" function which would have been replaced in Qt 7. Found in API review. Amends 2b1e3419c5ef43e964f40dbe79d7a7da0de5aa57 Pick-to: 6.9 Change-Id: I3ad94486543bdcb5ef5a7afd41f9cbb249ac92fb Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Use QT_MOC_COMPAT on deprecated signalsIvan Solovev2025-01-141-0/+1
| | | | | | | | | | | | | | | | | | | | To warn about the usage of the deprecated signal in a string-based connect as well. Amends: * e3c7af99ecdf9123933bbdfb4476b2d7187efd2a for QAbstractOAuth2::scopeChanged() * ed5e6769212dbc2aadb1f3031fc216f04df2ab75 for QAbstractOAuth2::error() * 90c7e3df75a901420f70389d16a6ebd53d6332be for QOAuth2AuthorizationCodeFlow::accessTokenUrlChanged() Found in Qt 6.9 API review. Pick-to: 6.9 Change-Id: I5f06aea8647cb417d21b825651e36d2953808461 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* QOAuth2AuthorizationCodeFlow: do not remove accessTokenUrl in Qt 7Ivan Solovev2025-01-091-3/+3
| | | | | | | | | | | | | | The property can be kept forever, simply delegating to the property of the base class. Amends 90c7e3df75a901420f70389d16a6ebd53d6332be. Found in Qt 6.9 API review. Pick-to: 6.9 Change-Id: I75f8b1843158da0af091e290be3d5748351ed7b4 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtNetworkAuth: fix QT_NO_HTTP checksIvan Solovev2025-01-081-1/+2
| | | | | | | | | | | | | | | | | | | | The QT_NO_HTTP definition is only available after including QtNetwork/qtnetwork-config.h. However, the code was doing this check before including any header. As a result, the checks could be ignored if such header is the first in the list of includes, or if nothing else includes qtnetwork-config.h before it. This patch makes sure that the QT_NO_HTTP definition is always available before doing the check. It is inspired by Qt 6.9 API review comments, but the problem exists in earlier branches as well, so picking to all active Qt 6 branches. Pick-to: 6.9 6.8 6.5 Change-Id: I7ddee5d41519c24a68df2e2cb956566cfe1d3619 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Qt 7: add QAbstractOAuth2::refreshTokens() virtual slotIvan Solovev2024-12-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The base class already contains all properties and signals related to access token refreshing. However, we can not add a new virtual slot during Qt 6 lifetime. This patch pre-programs the addition of this slot to Qt 7 and adjusts the refresh token logic to call the new slot directly from the base class. This eliminates the need to manually implement auto-refresh logic in the derived classes. The name of the new slot is different from the pre-existing slots in the derived classes, so this patch also pre-programs the renaming of the relevant slots. The patch also pre-programs documentation changes by providing Qt 7 versions of the relevant docs. Picking this change to 6.9 to minimize the amount of merge conflict resolutions. Task-number: QTBUG-132106 Pick-to: 6.9 Change-Id: I453e9aae096abbfddcb8076f808d4a055850f7e0 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* Deprecate QOAuth2AuthorizationCodeFlow::accessTokenUrl propertyIvan Solovev2024-12-191-0/+9
| | | | | | | | | | | | | | | | | ... and schedule it for removal in Qt 7. Update most of the unit-test to use the new property, leaving just some of them with a conditional check, to make sure that the old API is still tested. [ChangeLog][QOAuth2AuthorizationCodeFlow] Deprecated accessTokenUrl property and scheduled it for removal in Qt 7. Use QAbstractOAuth2::tokenUrl instead. Task-number: QTBUG-132106 Pick-to: 6.9 Change-Id: I0bbb32854380268f8b7226859911b6fc3bd9289e Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* QOAuth2AuthorizationCodeFlow: take setPkceMethod()'s length as qsizetypeMarc Mutz2024-06-241-1/+1
| | | | | | | | | | | | This prevents accidental narrowing on the call-side (and isn't slower than passing a shorter integer, which is the reason we don't use qint64 here). Found in API-Review. Pick-to: 6.8 Change-Id: I9c0cdc67ddf9d5d1bd6ccdbc8d860ffa874daf33 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* Add support for PKCEJuha Vuolle2024-05-221-0/+11
| | | | | | | | | | | | | | | | | | | | PKCE (RFC 7636) is a MUST in RFC 8252 which lays out OAuth2 best practices for native applications. PKCE mitigates the risk of authorization code intercepting. PKCE is only relevant for OAuth2 "Authorization Code" flow, which is the only OAuth2 flow Qt supports out of the box. The S256 method is set as the default. Sending out the PKCE parameters should not cause harm even if the authorization server didn't support them. [ChangeLog][QOAuth2AuthorizationCodeFlow] Added PKCE support and turned it on by default Fixes: QTBUG-124327 Change-Id: Ic0242be1b8afcd9baa3ff071989d58ddabf753a2 Reviewed-by: Ivan Solovev <ivan.solovev@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>
* QVariantMap -> QMultiMap<QString, QVariant> in many casesMårten Nordheim2020-08-111-2/+2
| | | | | | | | | | | | | | Following the separation of QMap and QMultiMap we can no longer create a QMultiMap<QString, QVariant> from a QVariantMap so entries need to be inserted through a raw loop. QMap can also no longer hold multiple values per key and as such parameters where this would be expected have changed to QMultiMap<QString, QVariant> as well. Task-number: QTBUG-85930 Change-Id: I5bdfe38c22ea0cdde5bd1336a0070514e8d6474f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-221-1/+1
|\ | | | | | | | | | | | | | | | | | | 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>
* | Move some functions to base classes to avoid virtualJesus Fernandez2017-05-301-2/+0
|/ | | | | | | | | | | OAuth base classes now support responseType, in OAuth2, the basic client identifier and the basic token (without secrets). The base class methods can be called to get and set the properties without needing to override pure virtual member functions. Task-number: QTBUG-60809 Change-Id: Id6b2aebe1a07e62c937078b5206aade53a9a85eb Reviewed-by: Edward Welbourne <edward.welbourne@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>
* OAuth supportJesus Fernandez2016-08-191-0/+112
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>