Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Tcl) Generate OAuth 1.0 SignatureDemonstrates how to generate an OAuth 1.0 signature.
load ./chilkat.dll set oauth [new_CkOAuth1] # All Chilkat classes can be unlocked at once at the beginning of a program # by calling UnlockBundle. It requires a Bundle unlock code. set chilkatGlob [new_CkGlobal] set success [CkGlobal_UnlockBundle $chilkatGlob "Anything for 30-day trial."] if {$success != 1} then { puts [CkGlobal_lastErrorText $chilkatGlob] delete_CkOAuth1 $oauth delete_CkGlobal $chilkatGlob exit } # Set input parameters: CkOAuth1_put_OauthVersion $oauth "1.0" CkOAuth1_put_OauthMethod $oauth "GET" CkOAuth1_put_OauthUrl $oauth "http://echo.lab.madgex.com/echo.ashx" CkOAuth1_put_ConsumerKey $oauth "key" CkOAuth1_put_ConsumerSecret $oauth "secret" CkOAuth1_put_Token $oauth "accesskey" CkOAuth1_put_TokenSecret $oauth "accesssecret" CkOAuth1_put_Nonce $oauth "01020304050607080102030405060708" CkOAuth1_put_Timestamp $oauth "1441659763" # Can be "HMAC-SHA1", "HMAC-SHA256", "RSA-SHA1", or "RSA-SHA2" CkOAuth1_put_SignatureMethod $oauth "HMAC-SHA256" set success [CkOAuth1_Generate $oauth] if {$success != 1} then { puts [CkOAuth1_lastErrorText $oauth] delete_CkOAuth1 $oauth delete_CkGlobal $chilkatGlob exit } # Examine the various outputs: puts [CkOAuth1_queryString $oauth] puts [CkOAuth1_baseString $oauth] puts [CkOAuth1_hmacKey $oauth] puts [CkOAuth1_signature $oauth] puts [CkOAuth1_encodedSignature $oauth] puts [CkOAuth1_authorizationHeader $oauth] puts [CkOAuth1_generatedUrl $oauth] delete_CkOAuth1 $oauth delete_CkGlobal $chilkatGlob |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.