my first success with Oauth (Yeah!!)

Apr 27, 2011 at 12:05 PM

thanks to your lib class and your c# example i wrote this in

Public Class Oauth

Const myConsumerKey As String = "4be261761b90235e6a0dfade3784ab8904d954fdb"    
Const myConsumerSecret As String = "mysecretcode"    
Const url_Request_token As String = "" 
Const url_Authorize_token As String = "" 
Const url_Convert_authorized_token_into_access_token As String = "" 
Const url_Call_remote_methods_using_access_token As String = "" 
Const url_realm As String = ""       <==== NOT SURE FOR THIS LINE

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        

Dim c As Consumer = New Consumer(myConsumerKey, myConsumerSecret) 
Dim reqToken As RequestToken = c.ObtainUnauthorizedRequestToken(url_Request_token, url_realm)

Process.Start(Consumer.BuildUserAuthorizationURL(url_Authorize_token, reqToken))

Console.Out.WriteLine("Input verifier")
Dim verifier As String = Console.In.ReadLine()
verifier = verifier.TrimEnd("\r", "\n").ToString
Dim accessToken As AccessToken = c.RequestAccessToken(verifier, reqToken, url_Convert_authorized_token_into_access_token, url_realm)


End Sub

it works fine, it opens the web page and ask me to autorize my application (exactly what i expect). I get a token.

I click ok and after IE shows an empty page with address=""
and "verifier" seems to be empty. 

I don't understand how works this part. It seems also vb doesn't wait my click on the authorize application button.

Apr 28, 2011 at 11:26 AM

YES !! it works. 

For Urban Rival, there is no verifier parameter, so just stop the program with a message box during the authorisation phase and ... enjoy

my verifier = "";

Thanks for this very nice library