Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
Integrate oauth_signature with oauth_request.
  • Loading branch information
Tim Fletcher committed Nov 6, 2008
1 parent 0b45f73 commit 198688dc33a39f51e7ed78a85d691c88c9223d58
Showing 2 changed files with 9 additions and 19 deletions.
@@ -17,7 +17,7 @@ header(Realm, Method, URL, ExtraParams, Consumer, TokenPair) ->

params(Method, URL, ExtraParams, Consumer, TokenPair) ->
{Params, TokenSecret} = oauth_params(TokenPair, Consumer, ExtraParams),
[{oauth_signature, oauth_signature:new(Method, URL, Params, Consumer, TokenSecret)}|Params].
[{oauth_signature, sign(Method, URL, Params, Consumer, TokenSecret)}|Params].

oauth_params({[], TokenSecret}, Consumer, ExtraParams) ->
{oauth_params(Consumer, ExtraParams), TokenSecret};
@@ -34,4 +34,11 @@ oauth_params(Consumer, ExtraParams) ->
{oauth_version, "1.0"}
], ExtraParams).

sign(RequestMethod, URL, Params, Consumer, TokenSecret) ->
ConsumerSecret = oauth_consumer:secret(Consumer),
case proplists:get_value(oauth_signature_method, Params) of
oauth_plaintext:signature(ConsumerSecret, TokenSecret);
"HMAC-SHA1" ->
oauth_hmac:signature({RequestMethod, URL, Params}, ConsumerSecret, TokenSecret)

This file was deleted.

0 comments on commit 198688d

Please sign in to comment.