此内容没有您所选择的语言版本。

3.3.2. Making an OAuth Request


Usually an OAuth client library is used to generate the request. An example OAuth request using curl is shown here to aid in understanding how it works.

Example 3.1. OAuth Request Example Using curl

$ curl 'https://satellite6.example.com/api/architectures' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json,version=2' \
-H 'FOREMAN-USER: User1' \
-H 'Authorization: OAuth oauth_version="1.0",oauth_consumer_key="secretkey",oauth_signature_method="hmac-sha1",oauth_timestamp=1321473112,oauth_signature=Il8hR8/ogj/XVuOqMPB9qNjSy6E='
In the example above architectures are listed using OAuth for authentication. The request is attempted as a user with login User1. If mapping is enabled in the Foreman settings, the result will only include architectures that user User1 can see. Note that the signature was constructed manually, this should change with any oauth_timestamp change. Also, the signature reflects every parameter, HTTP method, and URI change. Therefore it is recommend to use an OAuth client library to construct all OAuth parameters.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.