I am using the same page to authenticate and retrieve the data, here's
my code:
// Create an instance of Yahoo.Authentication
Authentication auth = new Authentication("myid",
"mysecret");
bool authenticate = true;
// Check if we are returning from login
if (Request.QueryString["token"] != null &&
Request.QueryString["token"].Length > 0)
{
// Make sure the call is valid
if (auth.IsValidSignedUrl(Request.Url) == true)
{
// Save the user token. It is valid for two weeks
auth.Token = Request.QueryString["token"];
auth.UpdateCredentials();
authenticate = false;
// Call web service and output result into a DIV
tag
if (auth.IsCredentialed)
{
string service =
string.Format("http://address.yahooapis.com/v1/searchContacts?
appid={0}&WSSID={1}", auth.ApplicationId, auth.WssId);
// THIS LINE IS GIVING 403 Forbidden ERROR
Div1.InnerHtml =
auth.GetAuthenticatedServiceString(new System.Uri(service));
}
else
{
authenticate = true;
}
}
}
if (authenticate)
{
// Redirect the user to the use sign-in page
Response.Redirect(auth.GetUserLogOnAddress().ToString());
}
any ideas why I am not being able to retrieve the list of contacts,
although my appID has access to the address book