Nilasini
Nilasini

Reputation: 414

Curl command for authorization code

Can anyone help me to find the answer for this question. In authorization grant type how to get the authorization code using curl command

Upvotes: 0

Views: 1948

Answers (2)

Sanchit Singhal
Sanchit Singhal

Reputation: 1

Request:

curl -I -H "Authorization: Uploadcare.Simple demopublickey:demoprivatekey" \ -X DELETE \ "https://api.uploadcare.com/files/03ccf9ab-f266-43fb-973d-a6529c55c2ae/storage/"

Response:

HTTP/1.1 302 FOUND Access-Control-Allow-Headers: Authorization Access-Control-Allow-Origin: https://uploadcare.com Allow: GET, POST, PUT, DELETE, OPTIONS, PATCH Content-Type: text/html; charset=utf-8 Date: Sun, 31 Aug 2014 21:00:51 GMT Location: https://api.uploadcare.com/files/03ccf9ab-f266-43fb-973d-a6529c55c2ae/ Content-Length: 0

Upvotes: 0

Hans Z.
Hans Z.

Reputation: 54088

The Authorization Code grant type was specifically designed to work with full-blown User Agents (read: browsers). Reverse engineering such a flow in cURL is discouraged. It would miss the point of getting user consent and making the authentication method independent from the Client. One should rather use a different flow with cURL such as the Resource Owner Password Credentials grant type or the Client Credentials grant type.

Upvotes: 2

Related Questions