| CMakeLists.txt |
|
1657 |
- |
| configure.cmake |
|
348 |
- |
| doc |
|
|
- |
| qabstractoauth.cpp |
!
\class QAbstractOAuth
\inmodule QtNetworkAuth
\ingroup oauth
\brief The QAbstractOAuth class is the base of all
implementations of OAuth authentication methods.
\since 5.8
The class defines the basic interface of the OAuth
authentication classes. By inheriting this class, you
can create custom authentication methods for different web
services.
It also contains some functions to ease the process of
implementing different authentication flows.
|
20346 |
- |
| qabstractoauth.h |
|
4974 |
- |
| qabstractoauth_p.h |
|
2409 |
- |
| qabstractoauth2.cpp |
!
\class QAbstractOAuth2
\inmodule QtNetworkAuth
\ingroup oauth
\brief The QAbstractOAuth2 class is the base of all
implementations of OAuth 2 authentication methods.
\since 5.8
The class defines the basic interface of the OAuth 2
authentication classes. By inheriting this class, you
can create custom authentication methods using the OAuth 2
standard for different web services.
A description of how OAuth 2 works can be found in:
\l {https://tools.ietf.org/html/rfc6749}{The OAuth 2.0
Authorization Framework}
|
53249 |
- |
| qabstractoauth2.h |
|
9890 |
- |
| qabstractoauth2_p.h |
|
6425 |
- |
| qabstractoauthreplyhandler.cpp |
!
\class QAbstractOAuthReplyHandler
\inmodule QtNetworkAuth
\ingroup oauth
\brief Handles replies to OAuth authentication requests.
\since 5.8
The QAbstractOAuthReplyHandler class handles the answers
to all OAuth authentication requests.
This class is designed as a base whose subclasses implement
custom behavior in the callback() and networkReplyFinished()
methods.
|
3410 |
- |
| qabstractoauthreplyhandler.h |
|
1214 |
- |
| qabstractoauthreplyhandler_p.h |
|
647 |
- |
| qoauth1.cpp |
!
\class QOAuth1
\inmodule QtNetworkAuth
\ingroup oauth
\brief The QOAuth1 class provides an implementation of the
\l {https://tools.ietf.org/html/rfc5849}{OAuth 1 Protocol}.
\since 5.8
\deprecated [6.13] OAuth 1.0 is deprecated in favour of OAuth 2 and
scheduled for removal in Qt 7. If your authorization server supports
it, use OAuth 2 instead.
QOAuth1 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.
QOAuth1 uses tokens to represent the authorization granted to the
client by the resource owner. Typically, token credentials are
issued by the server at the resource owner's request, after
authenticating the resource owner's identity (usually using a
username and password).
When making the temporary credentials request, the client
authenticates using only the client credentials. When making the
token request, the client authenticates using the client
credentials as well as the temporary credentials. Once the
client receives and stores the token credentials, it can
proceed to access protected resources on behalf of the resource
owner by making authenticated requests using the client
credentials together with the token credentials received.
|
35276 |
- |
| qoauth1.h |
|
5061 |
- |
| qoauth1_p.h |
|
3372 |
- |
| qoauth1signature.cpp |
!
\class QOAuth1Signature
\inmodule QtNetworkAuth
\ingroup oauth
\brief Implements OAuth 1 signature methods.
\since 5.8
\deprecated [6.13] OAuth 1.0 is deprecated in favor of OAuth 2,
and scheduled for removal in Qt 7.
OAuth-authenticated requests can have two sets of credentials:
those passed via the "oauth_consumer_key" parameter and those in
the "oauth_token" parameter. In order for the server to verify
the authenticity of the request and prevent unauthorized access,
the client needs to prove that it is the rightful owner of the
credentials. This is accomplished using the shared-secret (or
RSA key) part of each set of credentials.
OAuth specifies three methods for the client to establish its
rightful ownership of the credentials: "HMAC-SHA1", "RSA-SHA1",
and "PLAINTEXT". Each generates a "signature" with which the
request is "signed"; the first two use a digest of the data
signed in generating this, though the last does not. The
"RSA-SHA1" method is not supported here; it would use an RSA key
rather than the shared-secret associated with the client
credentials.
|
13589 |
- |
| qoauth1signature.h |
|
2912 |
- |
| qoauth1signature_p.h |
|
1790 |
- |
| qoauth2authorizationcodeflow.cpp |
!
\class QOAuth2AuthorizationCodeFlow
\inmodule QtNetworkAuth
\ingroup oauth
\brief The QOAuth2AuthorizationCodeFlow class provides an
implementation of the
\l {https://tools.ietf.org/html/rfc6749#section-4.1}
{Authorization Code Grant} flow.
\since 5.8
This class implements the
\l {https://tools.ietf.org/html/rfc6749#section-4.1}
{Authorization Code Grant} flow, which is used both to obtain and
to refresh access tokens. It is a redirection-based flow so the
user will need access to a web browser.
As a redirection-based flow this class requires a proper
reply handler to be set. See \l {OAuth 2.0 Overview},
QOAuthHttpServerReplyHandler, and QOAuthUriSchemeReplyHandler.
|
22638 |
- |
| qoauth2authorizationcodeflow.h |
|
3269 |
- |
| qoauth2authorizationcodeflow_p.h |
|
1615 |
- |
| qoauth2deviceauthorizationflow.cpp |
!
\class QOAuth2DeviceAuthorizationFlow
\inmodule QtNetworkAuth
\ingroup oauth
\brief The QOAuth2DeviceAuthorizationFlow class provides an
implementation of the
\l {https://datatracker.ietf.org/doc/html/rfc8628}
{Device Authorization Grant} flow.
\since 6.9
This class implements the
\l {https://datatracker.ietf.org/doc/html/rfc8628}
{Device Authorization Grant} flow, which is used to obtain
and refresh access tokens and ID tokens, particularly on devices lacking
a user-agent or with limited input capabilities. These devices include
televisions, machine HMIs, appliances, and IoT devices.
Device flow can be used on any platform and operating system
that is capable of SSL/TLS requests. Unlike
\l {QOAuth2AuthorizationCodeFlow}, this flow is not based on
redirects, and therefore does not use a
\l {QAbstractOAuthReplyHandler}{reply handler}.
\section1 Device Flow Usage
The following snippets illustrate the typical usage. First, we set up
the flow similarly to \l {QOAuth2AuthorizationCodeFlow}:
\snippet src_oauth_replyhandlers.cpp deviceflow-setup
Then we connect to
\l {QOAuth2DeviceAuthorizationFlow::}{authorizeWithUserCode}
signal to handle the user authorization:
\snippet src_oauth_replyhandlers.cpp deviceflow-handle-authorizewithusercode
This part is crucial to the flow, and how you handle it depends on your
specific use case. One way or another, the user needs to complete the
authorization.
Device flow does not define how this authorization completion
is done, making it versatile for different use cases.
This can be achieved by displaying the verification URI and user code
to the user, who can then navigate to it on another device.
Alternatively, you could present a QR code for the user to
scan with their mobile device, send to a companion application,
email to the user, and so on.
While authorization is pending, \l {QOAuth2DeviceAuthorizationFlow} polls
the server at specific intervals (typically 5 seconds) until the user
accepts or rejects the authorization, upon which the server responds
accordingly and the flow concludes.
Errors can be detected as follows:
\snippet src_oauth_replyhandlers.cpp deviceflow-handle-errors
\l {QAbstractOAuth2::serverReportedErrorOccurred()} signal can
be used to get information on specific RFC-defined errors.
However, unlike \l {QAbstractOAuth::requestFailed()}, it doesn't
cover errors such as network errors or client configuration errors.
Flow completion is detected similarly as with
\l {QOAuth2AuthorizationCodeFlow}, for example:
\snippet src_oauth_replyhandlers.cpp deviceflow-handle-grant
|
30093 |
- |
| qoauth2deviceauthorizationflow.h |
|
2423 |
- |
| qoauth2deviceauthorizationflow_p.h |
|
2515 |
- |
| qoauthglobal.h |
|
514 |
- |
| qoauthhttpserverreplyhandler.cpp |
|
21754 |
- |
| qoauthhttpserverreplyhandler.h |
|
1742 |
- |
| qoauthhttpserverreplyhandler_p.h |
|
2428 |
- |
| qoauthoobreplyhandler.cpp |
! \internal |
4053 |
- |
| qoauthoobreplyhandler.h |
|
1009 |
- |
| qoauthoobreplyhandler_p.h |
|
609 |
- |
| qoauthurischemereplyhandler.cpp |
|
14140 |
- |
| qoauthurischemereplyhandler.h |
|
1477 |
- |
| qoauthurischemereplyhandler_p.h |
|
1017 |
- |