I am trying to make some calls to google’s api from the backend workflow but I always get an an authentication error (my assumption is that the token is kept on the frontend). Is it possible for me to grab the token when the user is login in and store it so that I can use it in the backend workflow?
The scope depends upon what sort of API you are trying to access (in my case I am using google calendar API) - You can just google to find the scope.
Also, put the redirect URL into google App.
Profile Endpoint also you can google.
This way you don’t need to worry about storing the token (since token is valid for 24 hrs so this way you automatically get the latest token)
Happy to answer if you have other questions.
Thanks @jared.gibb I attempt this myself first and see how far I make it.
@ankur1 Do you know if it is possible to use the token created by the OAuth2 user-agent flow in the backend workflow? I’ve set it up where it works perfectly in the front, but I want to do a schedule API call to get a list of events (or emails) but I keep getting an authentication error
Oauth 2.0 (in my previous answer) put in the shared header so whenever you make the API call you to get the access token. The same you can do in the backend workflow.
List the API in the same folder and call it from backend workflow.
@ankur1 Thank you fro sharing the steps in detail.
I have to provide the google auth in my app. I need the “idtoken” which we get in response from google. Can you tell me how to get that idtoken? I mean do we have to make another GET or Post request ? What will be that API.?
Any help is appreciated.
Bubble at the moment doesn’t have a simple way of accomplishing this task. All solutions I have done either involves running the function outside of bubble (handling all the calls outside and just sending data to bubble) or manually making the calls to store the token in the database (which is a security risk and also you will have to worry about making sure you refresh or create a new token before every call).
TBH if you are at this point, you may want to look at solutions outside of bubble since you will continue to run into more issues in the future if you manage to get it to work inside bubble.