Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

296
Views
Google Calendar quickstart, user auth needed?

I have a web app that needs to allow for users to book an appointment. The app loads my calander and shows a visual representation of what timeslots are available from my calander. Each timeslot available was made into a button. When the user clicks the button, it needs to set the event for that time slot. The event details are pre-made, the client doesn't do anything but click the time they want.

Ill be adding a form to accept their email and add it to the "attendees" object so that it can update their calendar.

Using the javascript quickstart, you use

gapi.load('client:auth2', () => {
     gapi.client.init({
       apiKey: API_KEY,
       clientId: CLIENT_ID,
       discoveryDocs: DISCOVERY_DOCS,
       scope: SCOPES,
     });

To get access to my calendar. But the rest of the quickstart

.then(() => {
        gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus);
      });
function updateSigninStatus() {
        gapi.auth2.getAuthInstance().isSignedIn.get();
      }

Asks the user to sign into their own account using Oauth to add an event...

How do I just allow for them to add an event by clicking the timeslot button, without needing them to go through Oauth?

For visual representation of what it looks like: enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The reason why it's asking the user to sign in is because your code is trying to make their account add a new event. What you probably want is to use a service account to be able to create the events without need to log in. This needs to be done in the backend, as it will contain the private key (which should never be public). This is called server to server application.

References & further reading

  • Using OAuth 2.0 for Server to Server Applications (Google's OAuth 2.0 Guide)
  • Google APIs Node.js Client (GitHub project)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!