This group has been moved to the Google Apps API Help Forum
Please use the new forum: http://www.google.com/support/forum/p/apps-apis?hl=en

--Julian

On Dec 23, 11:43 am, Raj <[email protected]> wrote:
> Thanks Sanket,
>
> Here is code what I am trying to work with for the reference :
>
> In JSP I am putting this :
>
> <a href="https://www.google.com/accounts/AuthsubRequest?next=http://
> xx.xxx.xxx.xx:8080/GContacts/GoogleTest&scope=http://www.google.com/
> calendar/feeds/http://www.google.com/m8/feeds/
> contacts&secure=0&session=1">
>
> which after authentication redirect me to the  :http://xx.xx.xx.xx:
> 8080/GContacts/GoogleTest
>
> And here in the servlet below is the code where I want the userid and
> password comes from authsub :
>
>         protected void doGet(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException
>         {
>
>                 try
>                 {
>                         String token=AuthSubUtil.getTokenFromReply
> (request.getQueryString());
>                         String sessionToken =
> AuthSubUtil.exchangeForSessionToken("https","www.google.com",token,
> null);
>                         ContactsService contactsService = new
> ContactsService("GoogleTest");
>                         contactsService.setAuthSubToken(sessionToken,
> null);
>
>                         contactsService.setUserCredentials
> ("[email protected]", "xxxxxxx#");
>                         GoogleTest.printDateMinQueryResults
> (contactsService);
>                 }
>                 catch (AuthenticationException e)
>                 {
>                         e.printStackTrace();
>                 }
>
>         }
>
> }
>
> thanks in advance

--

You received this message because you are subscribed to the Google Groups 
"Google Contacts 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-contacts-api?hl=en.


Reply via email to