Visual Basic 6.0
Visual Basic 6.0
Generate OAuth 1.0 Signature
Demonstrates how to generate an OAuth 1.0 signature.Chilkat Visual Basic 6.0 Downloads
Dim success As Long
success = 0
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
success = 0
Dim oauth As New ChilkatOAuth1
' 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
Debug.Print oauth.LastErrorText
Exit Sub
End If
' Examine the various outputs:
Debug.Print oauth.QueryString
Debug.Print oauth.BaseString
Debug.Print oauth.HmacKey
Debug.Print oauth.Signature
Debug.Print oauth.EncodedSignature
Debug.Print oauth.AuthorizationHeader
Debug.Print oauth.GeneratedUrl