이 콘텐츠는 선택한 언어로 제공되지 않습니다.
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='
$ curl 'https://satellite6.example.com/api/architectures' \curl 'https://satellite6.example.com/api/architectures' \curl 'https://satellite6.example.com/api/architectures' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json,version=2' \
-H 'FOREMAN-USER: User1' \-H 'FOREMAN-USER: User1' \-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='-H 'Authorization: OAuth oauth_version="1.0",oauth_consumer_key="secretkey",oauth_signature_method="hmac-sha1",oauth_timestamp=1321473112,oauth_signature=Il8hR8/ogj/XVuOqMPB9qNjSy6E='-H 'Authorization: OAuth oauth_version="1.0",oauth_consumer_key="secretkey",oauth_signature_method="hmac-sha1",oauth_timestamp=1321473112,oauth_signature=Il8hR8/ogj/XVuOqMPB9qNjSy6E='
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.