Why am I having trouble sending requests to Google API's that have been authenticated through additional Firebase scopes?

Viewed 50

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

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?

0 Answers
Related