3.3.2. OAuth Request Format
Use an OAuth client library to construct all OAuth parameters. Every OAuth API request requires the FOREMAN-USER
header with the login of an existing Foreman user and the Authorization
header in the following format:
--header 'FOREMAN-USER: sat_username' \ --header 'Authorization: OAuth oauth_version="1.0",oauth_consumer_key="secretkey",oauth_signature_method="hmac-sha1",oauth_timestamp=1321473112,oauth_signature=Il8hR8/ogj/XVuOqMPB9qNjSy6E='
Example
This example lists architectures using OAuth for authentication. The request uses a sat_username username in the FOREMAN-USER
header. With the --foreman-oauth-map-users
set to true
, the response includes only architectures that the user has access to view. The signature reflects every parameter, HTTP method, and URI change.
Example request:
$ curl 'https://satellite.example.com/api/architectures' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json,version=2' \ --header 'FOREMAN-USER: sat_username' \ --header 'Authorization: OAuth oauth_version="1.0",oauth_consumer_key="secretkey",oauth_signature_method="hmac-sha1",oauth_timestamp=1321473112,oauth_signature=Il8hR8/ogj/XVuOqMPB9qNjSy6E='