9#include "mailtransport_export.h"
23namespace MailTransport
26class MAILTRANSPORT_EXPORT TokenResult
32 InvalidAuthorizationResponse,
36 TokenResult(ErrorCode errorCode,
const QString &errorText);
37 TokenResult(
const QString &accessToken,
const QString &refreshToken);
39 [[nodiscard]]
QString accessToken()
const;
40 [[nodiscard]]
QString refreshToken()
const;
43 [[nodiscard]] ErrorCode errorCode()
const;
44 [[nodiscard]]
QString errorText()
const;
47 ErrorCode mErrorCode = ErrorCode::OK;
54class MAILTRANSPORT_EXPORT OutlookOAuthTokenRequester :
public QObject
59 ~OutlookOAuthTokenRequester()
override;
61 void requestToken(
const QString &usernameHint = {});
62 void refreshToken(
const QString &refreshToken);
65 void finished(
const TokenResult &result);
68 [[nodiscard]] MAILTRANSPORT_NO_EXPORT std::optional<QUrl> startLocalHttpServer();
70 MAILTRANSPORT_NO_EXPORT
void handleNewConnection();
71 MAILTRANSPORT_NO_EXPORT
void handleSocketReadyRead();
72 MAILTRANSPORT_NO_EXPORT
void requestIdToken(
const QString &code);
73 MAILTRANSPORT_NO_EXPORT
void handleTokenResponse(
QNetworkReply *reply,
bool isTokenRefresh =
false);
74 MAILTRANSPORT_NO_EXPORT
void sendResponseToBrowserAndCloseSocket();
81 std::unique_ptr<PKCE> mPkce;
82 std::unique_ptr<QTcpServer> mHttpServer;
83 std::unique_ptr<QTcpSocket> mSocket;
84 std::unique_ptr<QNetworkAccessManager> mNam;
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:10 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.