Xojo Plugin
Xojo Plugin
Generate OAuth 1.0 Signature
Demonstrates how to generate an OAuth 1.0 signature.Chilkat Xojo Plugin Downloads
Dim success As Boolean
success = False
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
success = False
Dim oauth As New Chilkat.OAuth1
// 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 <> True) Then
System.DebugLog(oauth.LastErrorText)
Return
End If
// Examine the various outputs:
System.DebugLog(oauth.QueryString)
System.DebugLog(oauth.BaseString)
System.DebugLog(oauth.HmacKey)
System.DebugLog(oauth.Signature)
System.DebugLog(oauth.EncodedSignature)
System.DebugLog(oauth.AuthorizationHeader)
System.DebugLog(oauth.GeneratedUrl)