Skip to main content

Posts

Showing posts from November, 2015

Oauth2 GET/POST request samples

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)...