Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conferencing: How to trigger Calendar actions from OAuth callbacks #234

Closed
codinger41 opened this issue Nov 25, 2021 · 1 comment
Closed

Comments

@codinger41
Copy link

codinger41 commented Nov 25, 2021

Description

I'm trying to build a conferencing addon for Google calendar that kind of works like Google Meet. It requires authentication so in the createConference function, I'm throwing an error of type ConferenceDataService.ConferenceErrorType.AUTHENTICATION while attaching an authentication URL. I brought in the oauth package, defined an authentication function authCallback and it seems to work as expected.

The problem is that I need to trigger createConference after the authentication is successful so it can update the calendar event with the conferencing tool. I'm aware that createConference needs to return the dataBuilder object for the frontend to receive that update, but since authentication is required, I have to return the authentication error so it displays the login button for the user to login. Logging in works successfully so how do I update the conference on Google calendar event with the conferencing tool?

It's quite unclear from the documentation what needs to happen after the authCallback.

Here's what the auth callback looks like:

function authCallback(request) {
  const args = JSON.parse(request.parameter.args);
  const eventData = {
    ...args,
    ...request.parameter,
  };

  create3rdPartyConference(eventData);
  return HtmlService.createHtmlOutput('Success! You can close this window.');
}

Currently, what it does is to trigger create3rdPartyConference (nothing happens), even after building the conference data and triggering databuilder.build().

Additional

  • The calendar event isn't created by the time createConference is called, but it does pass an eventId and getting this event returns 404 since it's not created yet.
  • The end goal here is to take away the login button below and display the actual conferencing tool when authentication is successful and authCallback is triggered.

image

@codinger41
Copy link
Author

Closing this, I just figured appscript automatically calls createConference again if the authentication callback is successful 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant