vue.jsauthenticationgoogle-apivuejs3google-oauth

Google API access without using a private Google account


Test case

I'm trying to build a website that allows users to book an appointment with me based on the availability in my Google Calendar and simply creating the event in my calendar with their email address.

All is working fine with the help of this Vue 3 example and the guide from Google. When I'm clicking the button Authorize a popup is shown where I am asked to authenticate with my personal Google account and the events are correctly retrieved. The required CLIENT_ID, API_KEY, DISCOVERY_DOC and SCOPES are all set correctly.

Question

How is it possible to still be able to retrieve the events without the popup for authentication with my personal Google account?

Users of the web app booking tool will not have access with their personal Google account, or might not have a Google account at all. How can access be granted for the app to my calendar, so users don't have to sign in with a personal account?

Sorry if this seems like a stupid question, but I'm new to this.

Thank you for your help.


Solution

  • You will need to request offline access, store a refresh token and use the refresh token in the future to request a new access token in order to access your personal calendar account.

    if vue.js a client side javascript framework then you cant request offline access you need to use a server side language.