caroalvarezsilva / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Execution of authentication request returned unexpected result: 407 #507

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by varsha.w...@gmail.com on 24 May 2011 at 11:27

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
Are you sure your proxy is not blocking those requests?

Original comment by ccherub...@google.com on 25 May 2011 at 10:41

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago

Original comment by ccherub...@google.com on 10 Jun 2011 at 9:29