In my NextJS app I am using clerk for auth (Google SSO) and I want to be able to create a google meet event through the UI on behalf of the signed in user. I believe the way to do this is once a user has used signed in through google sso I should be able to retrieve their google access token that can be used to query the google calendar api and make the event. I have granted https://www.googleapis.com/auth/calendar.events https://www.googleapis.com/auth/calendar
as additional scopes in clerk for Google SSO so now users can authorise these on sign up or later on through the clerk ui.
The issue is getting the google access token. It is not in the user object by default. I don't know how I can obtain it. Maybe there is some way to obtain it at sign in and save it to the users metadata with a webhook? I think it should be easy or at least possible as otherwise I don't know why you can grant additional scopes for identity providers in clerk.
Would really appreciate any assistance. Cheers
I've searched the docs https://clerk.com/docs/authentication/social-connections-oauth#configure-additional-o-auth-scopes introduced additional o-auth scopes for google calendar api. Can't find anything on getting the google access token. GPT-4 can't solve it, thinks it should be in the user object by default which it isn't.