Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi ActiveX) Generate OAuth 1.0 SignatureDemonstrates how to generate an OAuth 1.0 signature.
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB; ... procedure TForm1.Button1Click(Sender: TObject); var oauth: TChilkatOAuth1; chilkatGlob: TChilkatGlobal; success: Integer; begin oauth := TChilkatOAuth1.Create(Self); // All Chilkat classes can be unlocked at once at the beginning of a program // by calling UnlockBundle. It requires a Bundle unlock code. chilkatGlob := TChilkatGlobal.Create(Self); success := chilkatGlob.UnlockBundle('Anything for 30-day trial.'); if (success <> 1) then begin Memo1.Lines.Add(chilkatGlob.LastErrorText); Exit; end; // Set input parameters: oauth.OauthVersion := '1.0'; oauth.OauthMethod := 'GET'; oauth.OauthUrl := 'http://echo.lab.madgex.com/echo.ashx'; oauth.ConsumerKey := 'key'; oauth.ConsumerSecret := 'secret'; oauth.Token := 'accesskey'; oauth.TokenSecret := 'accesssecret'; oauth.Nonce := '01020304050607080102030405060708'; oauth.Timestamp := '1441659763'; // Can be "HMAC-SHA1", "HMAC-SHA256", "RSA-SHA1", or "RSA-SHA2" oauth.SignatureMethod := 'HMAC-SHA256'; success := oauth.Generate(); if (success <> 1) then begin Memo1.Lines.Add(oauth.LastErrorText); Exit; end; // Examine the various outputs: Memo1.Lines.Add(oauth.QueryString); Memo1.Lines.Add(oauth.BaseString); Memo1.Lines.Add(oauth.HmacKey); Memo1.Lines.Add(oauth.Signature); Memo1.Lines.Add(oauth.EncodedSignature); Memo1.Lines.Add(oauth.AuthorizationHeader); Memo1.Lines.Add(oauth.GeneratedUrl); end; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.