Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

298
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda