Unable to authenticate with Boss(VB.NET)

I've been trying now for more than a day to try and connect to BOSS server just to get a set of search results a keyword. I keep getting this message:
Please provide valid credentials. OAuth oauth_problem="signature_invalid", realm="yahooapis.com"
. I've set up boss and have all the keys required to authenticate myself. If some one could look through this code and tell me what I'm doing wrong, it would really helpful.

I got a class OAuthBase here: http://oauth.googlecode.com/svn/code/vbnet/oAuth.vb that generates the signature. Here the code:
Dim uri As New Uri("http://yboss.yahooapis.com/ysearch/web?q=yahoo&format=xml")
Dim xmlresponse As String
xmlresponse = ""
Dim oauth As New OAuth.OAuthBase()
Dim oauth_version As String = "1.0"
Dim oauth_timestamp As String = oauth.GenerateTimeStamp()
Dim oauth_nonce As String = oauth.GenerateNonce()
Dim oauth_consumer_key As String = "My Customer key was placed here"
Dim oauth_secret_key As String = "My Secret key was placed here"
Dim oauth_signature_method As String = "HMAC-SHA1"
Dim nurl, nurlp As String
nurl = ""
nurlp = ""
Dim oauth_signature As String = oauth.GenerateSignature(New System.Uri("http://yboss.yahooapis.com/ysearch/web?q=yahoo&format=xml"), oauth_consumer_key, oauth_secret_key, "", "", "GET", oauth_timestamp, oauth_nonce, oauth.SignatureTypes.HMACSHA1, nurl, nurlp)
Dim drequest As HttpWebRequest = HttpWebRequest.Create(uri)
drequest.Headers.Add("oauth_version", oauth_version)
drequest.Headers.Add("oauth_timestamp", oauth_timestamp)
drequest.Headers.Add("oauth_nonce", oauth_nonce)
drequest.Headers.Add("oauth_consumer_key", oauth_consumer_key)
drequest.Headers.Add("oauth_signature_method", oauth_signature_method)
drequest.Headers.Add("oauth_signature", oauth_signature)
drequest.Method = WebRequestMethods.Http.Get
Dim response As HttpWebResponse = drequest.GetResponse()
Dim reader As New StreamReader(response.GetResponseStream())
xmlresponse = reader.ReadToEnd()

In some forum I saw an example where they used an Appid, but I tried adding my appid to the request but it did not work.
Basically, Im just trying to retrieve search results for a particular keyword. Everything including payment has been setup with Yahoo BOSS, now what am I doing wrong?

0 Replies

Recent Posts

in .NET Development