vb.net and Oauth, help a dummy

Apr 27, 2011 at 9:04 AM

Hello, 

I'll try to use Oauth with vb.net to create application for urban rival (nice game). 

i find my oauth class in "TwitterVB" (is a port of the Twitterizer library <http://code.google.com/p/twitterizer/>) 

I download some code from this web page but don't use it yet.

 

my vb code is 

Dim Oauth As New OAuthBGO (the class i found) 

Dim url_Request_token As New Uri(txturl_Request_token) 

timestamp = Oauth.GenerateTimeStamp() 
nonce = Oauth.GenerateNonce() 

Signature = Oauth.GenerateSignature(url_Request_token, 
OAuthBGO.HTTPMethod.GET.ToString, Key, Secret, "", "", timestamp, 
nonce, OAuthBGO.SignatureTypes.HMACSHA1, "", "", "", "") 

request = Oauth.GenerateRequest(url_Request_token, 
OAuthBGO.HTTPMethod.GET.ToString, Key, Signature, "", "", timestamp, 
nonce, OAuthBGO.SignatureTypes.HMACSHA1.ToString, "", "", "", "") 

=> i created GenerateRequest based on GenerateSignature 

txturl = txturl_Request_token & "/?request=" & request    => 

http://www.google.com/url?sa=D&q=http://www.urban-rivals.com/api/auth/request_token.php/%3Frequest%3DGET%26http%253A%252F%252Fwww.urban-rivals.com%252Fapi%252Fauth%252Frequest_token.php%26oauth_consumer_key%253D4be261761b90235e6a0dfade3784ab8904d954fdb%2526oauth_nonce%253D3426749%2526oauth_signature%253DYvl98w3NHhljuudYWUlHf7223%2525252Bc%2525253D%2526oauth_signature_method%253DHMACSHA1%2526oauth_timestamp%253D1303820623%2526oauth_version%253D1.0

 

Dim myWebRequest As HttpWebRequest = DirectCast(HttpWebRequest.Create(txturl), HttpWebRequest) 
myWebRequest.Method = "GET" 
Dim myWebResponse As HttpWebResponse = DirectCast(myWebRequest.GetResponse(), HttpWebResponse) 

i still have 401 ... What is wrong in this request ? 

 

Thanks 

Apr 27, 2011 at 9:07 AM

a little bug into txturl value :

txturl = "http://www.urban-rivals.com/api/auth/request_token.php/%3Frequest%3DGET%26http%253A%252F%252Fwww.urban-rivals.com%252Fapi%252Fauth%252Frequest_token.php%26oauth_consumer_key%253D4be261761b90235e6a0dfade3784ab8904d954fdb%2526oauth_nonce%253D3426749%2526oauth_signature%253DYvl98w3NHhljuudYWUlHf7223%2525252Bc%2525253D%2526oauth_signature_method%253DHMACSHA1%2526oauth_timestamp%253D1303820623%2526oauth_version%253D1.0"

Apr 27, 2011 at 12:09 PM

Hello,

sorry, it's not the right place for my request. 
i put it into http://oauthlib.codeplex.com/

Bye.