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 参考