Authenticating to get events from Google Calendar with a (local) Javascript
Is it possible to authenticate to google calendar (when you know the username/password) using its JavaScript API? I tried calendarService.setUserCredentials(username,开发者_C百科 password); but it didn't work
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
精彩评论