auth0 / docs

Auth0 documentation
MIT License
372 stars 1.62k forks source link

curl examples are not crossplatform #4832

Open santiagorp opened 7 years ago

santiagorp commented 7 years ago

Examples for CURL do not work properly in windows platforms using the windows command prompt (cmd.exe).

Customers do not manage to execute the examples when using examples like this:

curl --request POST \ 
--url https://bksv-sso-test.auth0.com/oauth/token \ 
--header 'content-type: application/json' \ 
--data '{"client_id":"CLIENTID","client_secret":"CLIENTSECRET","audience":"https://localhost/monica/","grant_type":"client_credentials"}'

However the following syntax works both in Shell and CMD command prompt:

curl --request POST --url https://bksv-sso-test.auth0.com/oauth/token --header "content-type: application/json" --data "{\"client_id\":\"CLIENT_ID_HERE\",\"client_secret\":\"CLIENT_SECRET_HERE\",\"audience\":\"https://localhost/monica/\",\"grant_type\":\"client_credentials\"}" 

We should rewrite the curl examples to use a syntax which is cross-platform and readable.

Ticket: https://auth0.zendesk.com/agent/tickets/26555

Related Auth0 manage issue: https://github.com/auth0/manage/issues/3211

mpaktiti commented 7 years ago

Thank you @santiagorp , we'll work on that. I think we should keep the whitespace since it "reads" more easily that way, let me know if you disagree.

curl --request POST 
--url https://bksv-sso-test.auth0.com/oauth/token 
--header "content-type: application/json" 
--data "{\"client_id\":\"CLIENT_ID_HERE\",\"client_secret\":\"CLIENT_SECRET_HERE\",\"audience\":\"https://localhost/monica/\",\"grant_type\":\"client_credentials\"}" 

@khorne3 Can you add this to trello and work on it next week?

santiagorp commented 7 years ago

I agree that it should be readable. However we need to be sure that the syntax for new lines works BOTH for unix AND windows. Otherwise we would need to examples.