开发者

Authenticating to get events from Google Calendar with a (local) Javascript

开发者 https://www.devze.com 2022-12-25 23:12 出处:网络
Is it possible to authenticate to google calendar (when you know the username/password) using its JavaScript API?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消