Qt Network Authorization

Qt Network Authorization provides a set of APIs that enable Qt applications to obtain limited access to online accounts and HTTP services without exposing users' passwords.

Currently, the supported authorization protocol is OAuth , versions 1 and 2.


Using a Qt module requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.

构建采用 CMake

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

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

另请参阅 构建采用 CMake 概述。

采用 qmake 构建

要配置采用 qmake 构建模块,把模块作为 Qt 变量的值添加到工程 .pro 文件中:

QT += networkauth


The goal of this module is to provide a way to handle different authentication methods present on the Internet.

There are several authentication systems, including:

These systems allow the application developers to create applications which use external authentication servers provided by an Authorization Server . Users of these services need not worry about passing their credentials to suspicious applications. Instead, the credentials are entered in a known and trusted web interface.


Changes to Qt Network Authorization 列出了 Qt 的 Qt 6 系列在模块 API 和功能方面所做出的重要改变。


Qt Network Authorization is available under commercial licenses from Qt 公司 。此外,它是可用的在 GNU GPL (一般公共许可) 第 3 版 。见 Qt 许可 进一步了解细节。


API 参考