Send a form to a protected resource with an OAuth 1.0a signed request
Same credentials and rules as GET /api/auth/oauth1. Fields of an application/x-www-form-urlencoded body are part of the signature; other body types are not signed. The OAuth parameters may go in the form body instead of the Authorization header, but not in both.Same credentials and rules as GET …. Fields of an application/x-www-form-urlencoded body are part of the signature; other body types are not signed. The OAuth parameters may go in the form body instead of the Authorization header, but not in both.
OAuth 1.0a signature: consumer apibee-consumer-key / apibee-consumer-secret, plus token apibee-access-token / apibee-token-secret, one from POST /api/auth/oauth1/access_token, or no token (two-legged)OAuth 1.0a signature: consumer apibee-consumer-key / apibee-consumer-secret, plus token apibee-access-token / apibee-token-secret, one from POST …, or no token (two-legged)
Parameters 7
| Name | Type | Description |
|---|---|---|
oauth_consumer_keyrequired | header · string | apibee-consumer-key. In the Authorization: OAuth header, the query string or a form body (one place only). |
oauth_token | header · string | apibee-access-token, an access token from POST /api/auth/oauth1/access_token, or left out for a two-legged request.apibee-access-token, an access token from POST …, or left out for a two-legged request. |
oauth_signature_methodrequired | header · string | HMAC-SHA1, HMAC-SHA256, HMAC-SHA512 or PLAINTEXT. |
oauth_signaturerequired | header · string | Base64 HMAC of the signature base string, or for PLAINTEXT the signing key itself: consumer_secret&token_secret, percent-encoded (& becomes %26). |
oauth_timestamp | header · string | Unix time in seconds, within 5 minutes of server time. Required for the HMAC methods; may be left out for PLAINTEXT. |
oauth_nonce | header · string | A random string; each one works once. Required for the HMAC methods; may be left out for PLAINTEXT. |
oauth_version | header · string | Optional. If sent, it must be 1.0. |
Request body
Optional. application/x-www-form-urlencoded. Any form fields; they are covered by the OAuth signature.
status=helloResponses
- 200
- Signature valid. Same body as GET /api/auth/oauth1.Signature valid. Same body as GET ….
- 400
- parameter_absent (a required OAuth parameter is missing), parameter_rejected (a parameter is duplicated or OAuth parameters are in more than one place), version_rejected or signature_method_rejected.
- 401
- consumer_key_unknown, token_rejected, token_expired, timestamp_refused, nonce_used or signature_invalid. Carries WWW-Authenticate: OAuth realm="apibee", oauth_problem="...".
Example
curl -X POST "https://api.testingapis.com/api/auth/oauth1" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H 'Authorization: OAuth oauth_consumer_key="apibee-consumer-key", oauth_token="apibee-access-token", oauth_signature_method="PLAINTEXT", oauth_signature="apibee-consumer-secret%26apibee-token-secret"' \
-d 'status=hello' \
-H "X-TestingApis-Key: YOUR_API_KEY"{
"authenticated": true,
"scheme": "oauth1",
"legs": "three-legged",
"signatureMethod": "PLAINTEXT",
"parametersIn": "Authorization header",
"consumerKey": "apibee-consumer-key",
"token": "apibee-access-token",
"tokenExpiresIn": null,
"user": {
"username": "apibee",
"name": "TestingAPIs Tester",
"email": "tester@example.com"
},
"timestamp": null,
"nonce": null,
"signatureBaseString": null
}Sign in to see the details
The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.