How to Create Events in Google Calendar API using OAuth2.0

How to Create Events in Google Calendar API using OAuth2.0

12/14/2021
1

Description

In this video we will learn how to use #OAuth2 to sign in a user to their #Google account and ask them the permission for their #calendar so that events can be created on their behalf. In this process we will learn a couple of things, like how to get the user email and profile information using OAuth2 and #openid, also we will learn how to add #scopes when accepting google sign in.

What we’ll cover:

1. We will start by creating a new Project in Google Developers console. Then we will configure out project for OAuth consent screen, enable Calendar API, add scopes for sign-in, and creating credentials like the api secret and the api key.

2. Then we create out frontend ReactJS application and connect google sign in to get the authorization code for offline use, which will then be eventually used at the backend - code will be exchanged to get refresh token, access token and id token.

3. Backend application will be a very simple express application.

Some other questions which will be answered in the video:

Q1. People often complain about their #refreshtokens being expired after 7 days.

Q2. People complain that they do not get refresh token when they use code to get the tokens server side.

--------------------------------------------------------------------------

📦FREE $100 credit @Digital Ocean: https://m.do.co/c/3208f08b3324

--------------------------------------------------------------------------

Subscribe: https://www.youtube.com/c/yourstruly267?sub_confirmation=1

--------------------------------------------------------------------------

💵Support the channel:

Paypal: https://www.paypal.me/trulymittal

Patreon: https://www.patreon.com/trulymittal

--------------------------------------------------------------------------

⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for 6 months and I love it! https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=yourstruly&utm_content=description-only

--------------------------------------------------------------------------

https://www.npmjs.com/package/react-google-login

https://www.npmjs.com/package/express-draft

https://www.npmjs.com/package/googleapis

https://myaccount.google.com/permissions

======================

✔ Other useful Playlists

======================

RestAPI (#NodeJS and MongoDB): https://www.youtube.com/playlist?list=PLdHg5T0SNpN3EoN3PEyCmPR42Ok_44OFT

API Authentication using #JWT: https://www.youtube.com/playlist?list=PLdHg5T0SNpN0ygjV4yGXNct25jY_ue70U

Firebase: https://www.youtube.com/playlist?list=PLdHg5T0SNpN2NimxW3piNqEVBWtXcraz-

Docker: https://www.youtube.com/playlist?list=PLdHg5T0SNpN0gFlL8AXvZdAHsvpkuW0Ba

MongoDB: https://www.youtube.com/watch?v=liocKBCVJyw&t=7s

Html/Css/Js: https://www.youtube.com/playlist?list=PLdHg5T0SNpN0saXVT9gfb2MESkiHG8YbP

Android: https://www.youtube.com/playlist?list=PLdHg5T0SNpN2cv8zhK-zQx2qXfJKap9kU

Challenges: https://www.youtube.com/playlist?list=PLdHg5T0SNpN20F2v0xYWeLRZtdehexzDi

#yoursTRULY #tutorial #howto #nodejs #reactjs

Chapters

Preview
1:43
Introduction
2:01
New Google Project
0:43
Enabling Calendar API
0:48
OAuth consent screen
3:07
OAuth2.0 client id and secret
1:49
Frontend ReactJS application
1:21
install React Google Login
1:28
Google Login component
2:35
IMPORTANT: Auth code to get access code and refresh token
3:55
Backend express application using express-draft
3:59
API route to generate access and refresh tokens
4:31
Fixing CORS issue using Proxy pass to backend
2:28
Refresh token Access token and ID token
4:43
Answer: Refresh token is NOT returned
3:54
Creating an event
0:44
Event form
6:56
Conditionally showing login and form
4:41
Calendar API to create event
7:44
Refresh token expires after 7 days
1:41