I'm writing a next.js application that requires a user to log in using their Google account, and then I need to get a list of their calendar events, potentially adding events into their accounts too.
I have Firebase V9 working flawlessly using firebase/auth, which, upon successful Auth flow returns me a user object with a getIdToken method that should allow me to make API calls to Google Services outlined in the additional scopes section in the firebase login loop. Every time I make a call to the Calendar API, however, I'm getting a 401 invalid credentials error.
I've found many resources
- firebase-gapi
- accessToken not returned
- "Firebase does NOT provide OAuth2 scopes to other google services like Calendar"
- "Use GAPI to login, not Firebase"
that outline that this isn't possible, but then, why should I be able to add additional scopes in the Firebase OAuth2 flow? What does that achieve?