이 페이지에서

QAbstractOAuthReplyHandler Class

OAuth 인증 요청에 대한 응답을 처리합니다. 더 보기...

헤더: #include <QAbstractOAuthReplyHandler>
CMake: find_package(Qt6 REQUIRED COMPONENTS NetworkAuth)
target_link_libraries(mytarget PRIVATE Qt6::NetworkAuth)
qmake: QT += networkauth
상속: QObject

공개 함수

QAbstractOAuthReplyHandler(QObject *parent = nullptr)
virtual ~QAbstractOAuthReplyHandler()
virtual QString callback() const = 0

공개 슬롯

virtual void networkReplyFinished(QNetworkReply *reply) = 0

신호

void callbackDataReceived(const QByteArray &data)
void callbackReceived(const QVariantMap &values)
void replyDataReceived(const QByteArray &data)
(since 6.6) void tokenRequestErrorOccurred(QAbstractOAuth::Error error, const QString &errorString)
void tokensReceived(const QVariantMap &tokens)

상세 설명

QAbstractOAuthReplyHandler 클래스는 모든 OAuth 인증 요청에 대한 응답을 처리합니다. 이 클래스는 기본 클래스로 설계되었으며, 하위 클래스는 callback() 및 networkReplyFinished() 메서드에서 사용자 정의 동작을 구현합니다.

멤버 함수 문서

[explicit] QAbstractOAuthReplyHandler::QAbstractOAuthReplyHandler(QObject *parent = nullptr)

parent 의 자식 노드로 응답 핸들러를 생성합니다.

[virtual noexcept] QAbstractOAuthReplyHandler::~QAbstractOAuthReplyHandler()

응답 핸들러를 제거합니다.

[pure virtual] QString QAbstractOAuthReplyHandler::callback() const

리소스 소유자 인증 단계가 완료되면 서버가 리소스 소유자를 다시 리디렉션할 절대 URI를 반환합니다. 클라이언트가 콜백을 수신할 수 없거나 다른 수단을 통해 콜백 URI가 설정된 경우, 매개변수 값을 "oob"(모두 소문자)로 설정하여 대역 외(out-of-band) 구성을 나타내야 합니다.

파생 클래스는 예상되는 콜백 유형을 제공하기 위해 이 함수를 구현해야 합니다.

[signal] void QAbstractOAuthReplyHandler::callbackDataReceived(const QByteArray &data)

이 신호는 콜백 요청이 수신되면 발생합니다. ` data `에는 구문 분석 전의 정보가 포함되어 있습니다.

[signal] void QAbstractOAuthReplyHandler::callbackReceived(const QVariantMap &values)

이 신호는 서버로부터 응답을 수신했을 때 발생하며, ` values `에는 토큰 자격 증명과 서버가 반환했을 수 있는 추가 정보가 포함됩니다. 이 신호가 발생하면 인증 절차가 완료된 것입니다.

[pure virtual slot] void QAbstractOAuthReplyHandler::networkReplyFinished(QNetworkReply *reply)

서버에서 요청의 유효성을 확인한 후 이 함수가 호출됩니다. 서버에서 수신한 데이터를 ` reply` 객체로 감싼 형태로 가져오려면 이 함수를 재구현하십시오. ` reply `는 ` deleteLater()`를 통해 자동으로 삭제되므로, 이 함수의 범위 밖에서는 절대 저장해서는 안 됩니다.

[signal] void QAbstractOAuthReplyHandler::replyDataReceived(const QByteArray &data)

이 신호는 HTTP 요청이 완료되고 데이터를 사용할 수 있게 되었을 때 발생합니다. ` data `에는 파싱 전의 응답 내용이 담겨 있습니다.

[signal, since 6.6] void QAbstractOAuthReplyHandler::tokenRequestErrorOccurred(QAbstractOAuth::Error error, const QString &errorString)

이 신호는 토큰 요청 또는 갱신 error 이 발생했을 때 발송됩니다. errorString 에서 오류에 대한 자세한 내용을 확인할 수 있습니다.

이 함수는 Qt 6.6에서 도입되었습니다.

QAbstractOAuth::requestFailed()도 참조하십시오 .

[signal] void QAbstractOAuthReplyHandler::tokensReceived(const QVariantMap &tokens)

이 신호는 서버로부터 새로운 tokens 가 수신되었을 때 발생합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.