Hi Bob,

You are correct that the authentication request won't be submitted
until your first request.  If you want to ascertain whether
authentication is successful from the get-go, you may submit a dummy
request to retrieve a single event to detect that. You may submit a
query with and URL like this:

http://www.google.com/calendar/feeds/default/private/full?q=none&max-results=1

This will submit a event query for event with keyword "none", you can
replace 'q' with anything you like.  This will force the the
authentication to be submitted and you may try to catch the exception
if it were incorrect.

Hope that helps,
Austin

On Oct 29, 2:07 am, Carver42 <[EMAIL PROTECTED]> wrote:
> This makes sense, and it is what I looked for, however, I don't get
> the exception until the next time I use the service (in my case it is
> the service.Insert()).
>
> This means that I need to check for the AuthenticationException on
> every service call... Rather than on the setUserCredentials() call.
>
> Thanks!
>
> Bob
>
> On Oct 29, 12:58 am, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Bob,
>
> > setUserCredentials() throws the AuthenticationException when the
> > authentication failed.  You can detect this failure by catching this
> > exception like this:
>
> > try (
> >   myService.setUserCredentials(user, pw);
> > ) catch(AuthenticationException e) {
> >    System.out.println('authentication failed');
>
> > }
>
> > Hope that helps,
> > Austin
>
> > On Oct 28, 7:54 pm, Carver42 <[EMAIL PROTECTED]> wrote:
>
> > > Is there a way to verify the user has supplied the correct username
> > > and pw when I call setUserCredientials()?
>
> > > I am using a CalendarService object and when I call
> > > setUserCredentials, I get no error if the user name and pw are
> > > incorrect.  It would be helpful if I could determine and correct the
> > > problem within my login method.
>
> > > Thanks,
>
> > > Bob- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to