Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

303
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda