Closed GoogleCodeExporter closed 8 years ago
Hi,
Can you share the code used to reproduce this issue?
Are you using a proxy that requires authentication? HTTP error 407 stands for
Proxy Authentication Required.
Thanks
Claudio
Original comment by ccherub...@google.com
on 25 May 2011 at 10:04
GAuthSubRequestFactory authFactory = new GAuthSubRequestFactory("weaver", "exampleCo-exampleApp-1");
WebProxy myProxy = new WebProxy();
// potentially, setup credentials on the proxy here
myProxy.Credentials = new NetworkCredential("username", "password");
// CredentialCache.DefaultNetworkCredentials;
// myProxy.UseDefaultCredentials = true;
authFactory.Proxy = myProxy;
// Create the Health Service
HealthService _ghService = new HealthService(authFactory.ApplicationName);
_ghService.RequestFactory.UseSSL = true;
_ghService.RequestFactory = authFactory;
// Set the user credentials
_ghService.setUserCredentials("ur@gmail.com", "urpassword");
// Authenticate the Credentials
try
{
String token = _ghService.QueryClientLoginToken();////error line
System.Windows.Forms.MessageBox.Show("CredentialsAuthentication Successful! ",
"Credentials authenticated successfully!",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Information);
}
catch (Google.GData.Client.InvalidCredentialsException ex)
{
System.Windows.Forms.MessageBox.Show("InvalidCredentials: " + ex.ToString(),
"Invalid Credentials!",
System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
}
// Get a user profile
HealthQuery profileQuery = new HealthQuery(
"https://www.google.com/h9/feeds/profile/default");
profileQuery.Digest = true;
HealthFeed feed = _ghService.Query(profileQuery);
Original comment by varsha.w...@gmail.com
on 25 May 2011 at 10:33
ya i m using proxy authentication.for that i have used network credential. Now
i m getting new error "The remote name could not be resolved: 'www.google.com'"
Original comment by varsha.w...@gmail.com
on 25 May 2011 at 10:37
Are you sure your proxy is not blocking those requests?
Original comment by ccherub...@google.com
on 25 May 2011 at 10:41
i m not sure.
is my proxy settings are right to GAuthSubRequestFactory object
myProxy.Credentials = new NetworkCredential("username", "password");
Original comment by varsha.w...@gmail.com
on 25 May 2011 at 11:11
They are correct assuming your proxy uses username and password for
authentication.
Please check with your system administrators for the correct setup.
Original comment by ccherub...@google.com
on 25 May 2011 at 11:14
Original comment by ccherub...@google.com
on 10 Jun 2011 at 9:29
Original issue reported on code.google.com by
varsha.w...@gmail.com
on 24 May 2011 at 11:27