MailTransport
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;
50 QString mRefreshToken;
54class MAILTRANSPORT_EXPORT OutlookOAuthTokenRequester :
public QObject
58 explicit OutlookOAuthTokenRequester(
const QString &clientId,
const QString &tenantId,
const QStringList &scopes, QObject *parent =
nullptr);
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-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:53:49 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.