Hi There,
Appreciate your response. Please use these examples for OAuth v1 protocol:
1. Create Request Token
URL:
http://SERVER_NAME/OAuth/api/v1/requestTokenDescription:
validate return code, oauth_token, and oauth_token_secret received from service call
Sample Payload:
POST /OAuth/api/v1/requestToken HTTP/1.1
Authorization: OAuth oauth_callback="http%3A%2F%2Fclient.example.net%3Fcb%3Dx%26t1%3D8",oauth_signature="RPOEnCcsgeApemXKEdkmL2STfek%3D",oauth_version="1.0",oauth_nonce="20fc8192-3018-4640-851f-53afb87bb57b",oauth_consumer_key="Ow91XrHaMa96EXywhFAzx9ugDZSyqgRa99EjeQpHzIb2gUgyij0dXI9",oauth_signature_method="HMAC-SHA1",oauth_token="",oauth_timestamp="1291832574"
Host: SERVER_NAME
Sample Response:
HTTP/1.1 200 OK
Date: Mon, 13 Dec 2010 21:56:51 GMT
Content-Type: application/x-www-form-urlencoded
Server: Jetty(7.0.2.v20100331)
Content-Length: 172
oauth_callback_confirmed=true&oauth_token=fLgHIOJczx9d9JRC0SSMa9jXQinjZJRa9BnpOjoHtyy9NxOMMWbMIb2&oauth_token_secret=40mjSR07fq9c2MgAKGcft2UqjZHb87Oa9GQWqzBXZLy9BHusta8vJV9
2. Authorize Request Token
POST URL:
http://SERVER_NAME/OAuth/api/authorize? ... xOMMWbMIb2Description:
validate return code, and response redirect is callback URL, including oauth_token, and oauth_verifier in URL
Sample Response:
http://client.example.net/?cb=x&t1=8&oa ... nbISA608O23. Create an Access Token
Description: validate return code, oauth_token, and oauth_verifier received from service call
URL:
http://SERVER_NAME/OAuth/api/v1/accessTokenSample Payload:
POST /OAuth/api/v1/accessToken HTTP/1.1
Authorization: OAuth oauth_callback="http%3A%2F%2Fclient.example.net%3Fcb%3Dx%26t1%3D8",oauth_signature="RPOEnCcsgeApemXKEdkmL2STfek%3D",oauth_version="1.0",oauth_nonce="20fc8192-3018-4640-851f-53afb87bb57b",oauth_consumer_key="Ow91XrHaMa96EXywhFAzx9ugDZSyqgRa99EjeQpHzIb2gUgyij0dXI9",oauth_signature_method="HMAC-SHA1",oauth_token="fLgHIOJczx9d9JRC0SSMa9jXQinjZJRa9BnpOjoHtyy9NxOMMWbMIb2",oauth_verifier="WjsqQqJKWj2pdSOyq0tXI9dbfGSYPzda9n0ZAFem7ft2wnbISA608O2",oauth_timestamp="1291832574"
Host: SERVER_NAME
Sample Response:
HTTP/1.1 200 OK
Date: Mon, 13 Dec 2010 22:03:14 GMT
Content-Type: application/x-www-form-urlencoded
Server: Jetty(7.0.2.v20100331)
Content-Length: 142
oauth_token=zKlsBOrjcR9CHcUiGJRMa9ZbojLIu6da9I6BV5srjnV9hYONZseQ0y9&oauth_token_secret=ohvGokQKwb29NhBWVKtRq9PmCqQIu6da9ZswIFi9JDy9yLgbsMVxAb2
4. Gain info / access to another service, e.g. access to customer's library of pictures hosted by another service, in many cases, external, so services need not share user's private credentials
-- '3rd party' service call, which may be another service within our network or a partner site, leveraging the OAuth passed creds (e.g. verifier).
It's a bit more complex, such as there are oauth parameters in the Authorization header which require the 'person' calling the service to provide unique oauth_timestamp and oauth_nonce values to prevent against service attack (I believe); and for security, be able to sign these service requests e.g. oauth_signature_method="HMAC-SHA1". Each parameter in the Authorization header, such as oauth_timestamp, must be able to be programatically updated between service calls, and these parameters must also have the ability to change from the return values of the service calls, e.g. recv'd, oauth_token must be able to be used in subsequent service calls.
Any questions, please give me a shout. Appreciate your help!!!