Qt Network Authorization

Qt Network Authorization provides a set of APIs that enable Qt applications to implement common authorization and authentication protocols. For example, an application can implement access controls such as providing limited access to online accounts and HTTP services without exposing user passwords.

This module focuses on OAuth 2.0 and provides limited support for OpenID . Refer to the section below about supported protocols .

使用模塊

使用 Qt 模塊需要直接 (或透過其它依賴) 鏈接到模塊庫。一些構建工具對此有提供專門支持,包括 CMake 和 qmake。

構建采用 CMake

使用 find_package() 命令以在 Qt6 包中定位所需的模塊組件:

find_package(Qt6 REQUIRED COMPONENTS NetworkAuth)
target_link_libraries(mytarget PRIVATE Qt6::NetworkAuth)
					

另請參閱 構建采用 CMake 概述。

采用 qmake 構建

要配置采用 qmake 構建模塊,把模塊作為 Qt 變量的值添加到工程 .pro 文件中:

QT += networkauth
					

支持的身份驗證和身份驗證協議

Qt Network Authorization module supports functionalities from:

These systems use a trusted authorization server for issuing access tokens so that users do not send credentials to resources and resource owners do not directly manage user credentials. For example, a user of a cloud-based photo album website does not have to worry about passing their credentials to the website. Instead, the credentials are managed by a trusted authorization service through a web interface.

文章和指南

許可

Qt Network Authorization 在商業許可下是可用的來自 Qt 公司 。此外,它是可用的根據 GNU GPL (一般公共許可) 第 3 版 。見 Qt 許可 進一步瞭解細節。

範例

API 參考