Qt Network 授权
Qt Network 授权提供了一套 API,可让 Qt 应用程序在不暴露用户密码的情况下,获得对在线账户和 HTTP 服务的有限访问权限。
目前,支持的授权协议是OAuth(版本 1 和 2)。
使用模块
使用 Qt 模块需要直接或通过其他依赖关系与模块库链接。有几种构建工具为此提供了专门支持,包括 CMake 和 qmake。
使用 CMake 构建
使用find_package()
命令在 Qt6 软件包中找到所需的模块组件:
find_package(Qt6 REQUIRED COMPONENTS NetworkAuth) target_link_libraries(mytarget PRIVATE Qt6::NetworkAuth)
另请参阅使用 CMake 构建概述。
使用 qmake 构建
要配置模块以便用 qmake 构建,可在项目的 .pro 文件中将模块添加为 QT 变量的值:
QT += networkauth
概述
本模块旨在提供一种处理互联网上不同身份验证方法的方法。
目前有几种身份验证系统,包括
这些系统允许应用程序开发人员创建使用授权服务器提供的外部身份验证服务器的应用程序。这些服务的用户不必担心将自己的凭证传递给可疑的应用程序。相反,凭据是在一个已知的、可信的网络界面上输入的。
文章和指南
许可证
Qt Network 授权可从The Qt Company 获得商业许可。此外,它还受GNU 通用公共许可证第 3 版的保护。有关详细信息,请参阅Qt Licensing。
示例
API 参考
© 2025 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.