Requesting an access token:
curl -v -X POST \
-H "Content-Type: application/json" \
'http://localhost:8080/my-server/oauth/token?username=ercan&password=password&client_id=my-client-with-secret&client_secret=password&grant_type=client_credentials&scope=read'
Refreshing a token:
curl -v -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=" \
'http://localhost:8080/oauth2-provider/oauth/token?grant_type=refresh_token&refresh_token=ab06022f-247c-450a-a11e-2ffab116e3dc'
curl -v -X GET \
-H "Accept: application/json" -H "Content-Type: application/json" \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
'http://localhost:8080/my-server/sample/result' | json_reformat > output.json
==> Format xml output (| json_reformat)
curl -v -X GET \
-H "Accept: application/xml" -H "Content-Type: application/xml" \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
'http://localhost:8080/my-server/sample/result' | xmllint --format - > output.xml
==> Format xml output (| xmllint --format -)
curl -v -X POST \
-HContent-type:application/xml -HAccept:application/xml \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
--data '<?xml version="1.0" encoding="UTF-8"?><REQUEST><DeviceType>dt1</DeviceType></REQUEST>' \
'http://localhost:8080/my-server/sample/request'
curl -v -X GET \
-H "Accept: application/xml" -H "Content-Type: application/xml" \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
'http://localhost:8080/my-server/sample/cust' | xmllint --format - > recognition.xml
curl -v -X POST \
-HContent-type:application/xml -HAccept:application/xml \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
--data '@recognition.xml' \
'http://localhost:8080/my-server/appointment/checkRecognition'
http://localhost:8080/my-server/oauth/token?username=ercan&password=password&client_id=my-client-with-secret&client_secret=password&grant_type=client_credentials&scope=read
http://localhost:8080/my-server/sample/result?access_token=72d4a91d-7989-4d65-b52f-c788ecae87c2
http://localhost:8080/my-server/sample/result.json?access_token=72d4a91d-7989-4d65-b52f-c788ecae87c2
http://localhost:8080/my-server/oauth/clients/my-client-with-secret/users/ercan/tokens?access_token=1a4da441-920b-4a5c-bcff-66b4f4f9a4b2
http://localhost:8080/my-server/oauth/authorize?client_id=my-less-trusted-client&redirect_uri=xxx&scope=trust&response_type=token
curl -v -X POST \
-H "Content-Type: application/json" \
'http://localhost:8080/my-server/oauth/token?username=ercan&password=password&client_id=my-client-with-secret&client_secret=password&grant_type=client_credentials&scope=read'
Refreshing a token:
curl -v -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=" \
'http://localhost:8080/oauth2-provider/oauth/token?grant_type=refresh_token&refresh_token=ab06022f-247c-450a-a11e-2ffab116e3dc'
curl -v -X GET \
-H "Accept: application/json" -H "Content-Type: application/json" \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
'http://localhost:8080/my-server/sample/result' | json_reformat > output.json
==> Format xml output (| json_reformat)
curl -v -X GET \
-H "Accept: application/xml" -H "Content-Type: application/xml" \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
'http://localhost:8080/my-server/sample/result' | xmllint --format - > output.xml
==> Format xml output (| xmllint --format -)
curl -v -X POST \
-HContent-type:application/xml -HAccept:application/xml \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
--data '<?xml version="1.0" encoding="UTF-8"?><REQUEST><DeviceType>dt1</DeviceType></REQUEST>' \
'http://localhost:8080/my-server/sample/request'
curl -v -X GET \
-H "Accept: application/xml" -H "Content-Type: application/xml" \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
'http://localhost:8080/my-server/sample/cust' | xmllint --format - > recognition.xml
curl -v -X POST \
-HContent-type:application/xml -HAccept:application/xml \
-H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \
--data '@recognition.xml' \
'http://localhost:8080/my-server/appointment/checkRecognition'
http://localhost:8080/my-server/oauth/token?username=ercan&password=password&client_id=my-client-with-secret&client_secret=password&grant_type=client_credentials&scope=read
http://localhost:8080/my-server/sample/result?access_token=72d4a91d-7989-4d65-b52f-c788ecae87c2
http://localhost:8080/my-server/sample/result.json?access_token=72d4a91d-7989-4d65-b52f-c788ecae87c2
http://localhost:8080/my-server/oauth/clients/my-client-with-secret/users/ercan/tokens?access_token=1a4da441-920b-4a5c-bcff-66b4f4f9a4b2
http://localhost:8080/my-server/oauth/authorize?client_id=my-less-trusted-client&redirect_uri=xxx&scope=trust&response_type=token
Comments
Post a Comment