views:

14

answers:

1

Is it possible to authenticate to google calendar (when you know the username/password) using its JavaScript API? I tried calendarService.setUserCredentials(username, password); but it didn't work

A: 
import com.google.gdata.client.calendar.*
import com.google.gdata.data.*
import com.google.gdata.data.calendar.*
import com.google.gdata.data.extensions.*
import com.google.gdata.util.*
import java.net.URL
import java.text.SimpleDateFormat
String link = link

myService = new CalendarService( "calName" )
try {
myService.setUserCredentials( "user", "password" )
} catch ( AuthenticationException e ) {
    // Invalid credentials
    e.printStackTrace()
}

works just fine, but it does seem to need Java 1.6

john renfrew