AutoIt
AutoIt
Generate OAuth 1.0 Signature
Demonstrates how to generate an OAuth 1.0 signature.Chilkat AutoIt Downloads
Local $bSuccess = False
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$bSuccess = False
$oOauth = ObjCreate("Chilkat.OAuth1")
; Set input parameters:
$oOauth.OauthVersion = "1.0"
$oOauth.OauthMethod = "GET"
$oOauth.OauthUrl = "http://echo.lab.madgex.com/echo.ashx"
$oOauth.ConsumerKey = "key"
$oOauth.ConsumerSecret = "secret"
$oOauth.Token = "accesskey"
$oOauth.TokenSecret = "accesssecret"
$oOauth.Nonce = "01020304050607080102030405060708"
$oOauth.Timestamp = "1441659763"
; Can be "HMAC-SHA1", "HMAC-SHA256", "RSA-SHA1", or "RSA-SHA2"
$oOauth.SignatureMethod = "HMAC-SHA256"
$bSuccess = $oOauth.Generate()
If ($bSuccess <> True) Then
ConsoleWrite($oOauth.LastErrorText & @CRLF)
Exit
EndIf
; Examine the various outputs:
ConsoleWrite($oOauth.QueryString & @CRLF)
ConsoleWrite($oOauth.BaseString & @CRLF)
ConsoleWrite($oOauth.HmacKey & @CRLF)
ConsoleWrite($oOauth.Signature & @CRLF)
ConsoleWrite($oOauth.EncodedSignature & @CRLF)
ConsoleWrite($oOauth.AuthorizationHeader & @CRLF)
ConsoleWrite($oOauth.GeneratedUrl & @CRLF)