6 messages in com.googlegroups.google-base-data-api[Google-Base-API] Re: C# Client Libra...
FromSent OnAttachments
TheAgustin11 Jul 2008 11:09 
Eric (Google)11 Jul 2008 14:52 
Agustin Garzon11 Jul 2008 15:56 
Eric (Google)14 Jul 2008 21:47 
Agustin Garzon15 Jul 2008 05:55 
Eric (Google)15 Jul 2008 11:46 
Subject:[Google-Base-API] Re: C# Client Library throws INVALID CREDENTIALS message
From:Eric (Google) (api.@google.com)
Date:07/15/2008 11:46:16 AM
List:com.googlegroups.google-base-data-api

Glad to hear you solved the problem :)

The only thing I can suggest is to make sure you're using the correct Google Account/password combination. ClientLogin will first attempt to verify the email address as a Google Apps (HOSTED) account and then as a Google Account.

Eric

On Jul 15, 5:55 am, "Agustin Garzon" <ven@webmuyfacil.com> wrote:

Thanks for your help Eric.

I got this working last weekend fortunately. I wasn't aware GBaseService.RequestFactory would help doing the trick, so I started digging through the Library source code until I reached the gauthrequest.cs file on the C# Core project.

As you say, it defaults the AccountType to HOSTED_OR_GOOGLE. For some reason it wouldn't work. That has to be some unresolved bug.

Anyway, I found the RequestFactory property on the GBaseService class, I casted it to GDataGAuthRequestFactory and set its AccountType to GOOGLE and it started working ok.

C# Code looks like this:

            GBaseService service = new GBaseService(appName, devKey);             service.setUserCredentials(gUsr, gPass);

            GDataGAuthRequestFactory f = (GDataGAuthRequestFactory)service.RequestFactory;             f.AccountType = "GOOGLE";

            string authToken = service.QueryAuthenticationToken();  /// <<< WORKS OK !!

Why it doesn't accept "HOSTED_OR_GOOGLE" is something I can't tell. But I'm ok for now with the solution.

Best regards. Agustin.

-----Original Message----- From: Goog@googlegroups.com

[mailto:Goog@googlegroups.com] On Behalf Of Eric (Google) Sent: Tuesday, July 15, 2008 1:48 AM To: Google Base Data API Subject: [Google-Base-API] Re: C# Client Library throws INVALID CREDENTIALS message

Hi Agustin,

You should be able to do something like:

GDataGAuthRequestFactory reqFactory = new GDataGAuthRequestFactory("gbase", "company-appName-v1.0"); reqFactory.AccountType = "HOSTED_OR_GOOGLE"; Service service = new Service(); service.RequestFactory = reqFactory;

By default the .NET library uses HOSTED_OR_GOOGLE for the accountType parameter.

To answer your second question, you can't determine what type of account the user entered.  For that reason, I  recommend keeping HOSTED_OR_GOOGLE as the default.

Hope this helps, Eric

On Jul 11, 3:57 pm, "Agustin Garzon" <ven@webmuyfacil.com> wrote:

Dear Eric,

Thanks for such a prompt response! I swear I read that posting. I'm having the same problem that the person who posted that thread. I'm unable to property to specify the account type when logging in.

I'm seeing the Phyton example, but I don't see a way to translate it to C# I have installed the Google.GData.Client.dll and Google.GData.GoogleBase.dll

Am I missing something?

First, how can I specify the account type when logging in?

Second, how can I tell if it's a GOOGLE or a HOSTED account?

Thanks a lot for your time. I have a couple more questions but my first priority would be having the authentication working.

Cordially, Agustin.

-----Original Message----- From: Goog@googlegroups.com

[mailto:Goog@googlegroups.com] On Behalf Of Eric (Google) Sent: Friday, July 11, 2008 6:53 PM To: Google Base Data API Subject: [Google-Base-API] Re: C# Client Library throws INVALID CREDENTIALS message

Hi Agustin,

Could this be

related?http://groups.google.com/group/Google-Base-data-API/browse_thread/th r...

69573caa3fc04/16b59cd933fe4fd8?hl=en&lnk=gst&q=INVALID+CREDENTIALS#16b 59cd93 3fe4fd8

Also, the username needs to be a full email address so do make sure that's what setUserCredentials() is getting.

Let me know, Eric

On Jul 11, 11:10 am, TheAgustin <ven@webmuyfacil.com> wrote:

Hi there people.

I had a Google Account I used for Analytics. I created a Google Base Account and I'm using the same email for both accounts. When I sign in on Google Accounts through the browser I can see both my accounts.

Now the tricky part. When I try to authenticate on the Google Base using the C# Client Library, I get an "Invalid Credentials" message. It's really weird because if I use a fresh new Google Account, it authenticates correctly.

It seems to be throwing the error only for that Google Account.

Dim service As New GBaseService(tbApplication.Text, tbBaseKey.Text) service.setUserCredentials(tbBaseUser.Text, tbBasePass.Text)

' ' ' THROWS THE ERROR Dim r As String = service.QueryAuthenticationToken()

Any idea why is this happening ? I'm 200% sure I'm using the right user / pass / devkey. With a fresh new google base account everything goes well. With an older google account (containing Analytics and Google Base) it doesn't work.

Look forward to receiving any insight.

Cordially, Agustin Garzon.