[fpc-pascal] Just a question about OAuth 2.0 implementation
silvioprog at gmail.com
Mon Apr 14 15:02:24 CEST 2014
2014-04-14 9:49 GMT-03:00 Michael Van Canneyt <michael at freepascal.org>:
> On Mon, 14 Apr 2014, silvioprog wrote:
>> Just a question, anyone here has implemented some code for OAuth 2.0?
>> (FPC or Delphi)
>> I implemented with 1.0 in my new TDropbox class, but now I'm trying to
>> implement it with 2.0, because I'm needing to make an
>> automatic authorization in a server side app.
>> So, if you prefer no need to show me code, I'm just wondering if anyone
>> has tried and already succeeded.
> It is on my agenda. I was planning to add the OAuth 1.0 implementation of
> Reinier to fcl-web,
> then look at OAuth 2.0. I will be needing it myself.
Very nice. For 1.0 was easy, because I found a base code in PHP:
class function TDropboxOAuthUtil.GenerateAuthorizationContent(
const AAppKey: string): string;
'oauth_consumer_key=' + AAppKey +
'&oauth_nonce=' + GenerateNonce +
'&oauth_timestamp=' + GenerateTimeStamp +
class function TDropboxOAuthUtil.GenerateAuthorizationUrl(const AAppKey,
AAppSecret: string): string;
Result := GenerateAuthorizationContent(AAppKey);
VSignature := 'POST&' + EncodeUrl(API_URL + '/oauth/request_token') + '&'
Result := API_URL + '/oauth/request_token?' + Result;
VSignature := EncodeBase64(HMAC_SHA1(VSignature, AAppSecret + '&'));
Result := Result + '&oauth_signature=' + EncodeUrl(VSignature);
Now I'm trying with 2.0, if it work, I'll send you all my drafts.
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal