Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing authorization header for oauth token request

I using java to implement oauth for obtaining an unauthorized request token. How do I pass the parameters in the authorization header? I need to pass :

GET /request_token HTTP/1.1
Host: photos.example.net:80
Authorization: OAuth realm="http://photos.example.net/request_token",
    oauth_consumer_key="dpf43f3p2l4k3l03",
    oauth_nonce="kllo9940pd9333jh",
    oauth_timestamp="1191242096",
    oauth_signature_method="HMAC-SHA1",
    oauth_version="1.0",
    oauth_signature="tR3%2BTy81lMeYAr%2FFid0kMTYa%2FWM%3D"

How do I go about that?

like image 787
user1166647 Avatar asked Jan 24 '12 09:01

user1166647


1 Answers

For those looking for an example of how to pass the OAuth2 authorization (access token) in the header (as opposed to using a request or body parameter), here is how it's done:

Authorization: Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
like image 158
Jonathan Avatar answered Nov 15 '22 11:11

Jonathan