gchjoshua
gchjoshua

Reputation: 1

How to use PassportJS with Google Calendar (extracting calendar events)

I am trying to use PassportJS (Google OAuth Strategy) to authenticate users and extract calendar events once they have logged in and granted permissions.

I've seen the Google Calendar API Node.js Quickstart but they are using it via the OAuth2 client. Is using PassportJS to do what I want possible? Thanks!

Upvotes: 0

Views: 1384

Answers (1)

jasonandmonte
jasonandmonte

Reputation: 2028

Yes, this is definitely possible with Passport. You will need to configure a Google strategy for Passport and include the Calendar API scope https://www.googleapis.com/auth/calendar.

Reference with code: https://github.com/jaredhanson/passport-google-oauth2

Then you can use the returned access tokens to make requests to the Calendar API.

Events Resource: https://developers.google.com/calendar/v3/reference/events/list

Upvotes: 1

Related Questions