Obtaining Token from Oauth User Agent Flow

Hi Everyone,

I have successfully set up the Oauth User Agent Flow for Google as I want to all people to be able to use their Google credentials to sign into my Firebase app (and eventually will set it up so then can do the same with Facebook).

However, the API call to log people into Firebase requires the access token to be placed in JSON in the POST request body as so:

 "postBody": "access_token=[GOOGLE_ACCESS_TOKEN]&providerId=google.com",
 "requestUri": "http://genericredirect.com",
 "returnIdpCredential": true,
 "returnSecureToken": true

How do we dynamically insert the GOOGLE_ACCESS_TOKEN that is generated from the Google sign in request?

It seems to me that Bubble attempts to automatically place it in the header, but I need it in a specific format in the body. Is it possible to do what I am trying to do or do I need to go about this entirely differently?



Do you save the access token to the User?

That is what I am trying to figure out how to do. I didn’t know if there was a way to get the token in the workflow for instance.

Because then I could just make that dynamic in the body JSON and call it from the user object in the workflow.

Is this possible to do?

Yeah it is. I can take some screen shots of how I am doing it on “Do When” workflows. Then I am able to reference the User token in api calls.

Ah that would be awesome. I’ve been very stuck on this.

When using bubble’s prebuilt social logins, are they doing any work in the background to refresh tokens and ensure that they are up to date, which we then have to do ourselves?

I just want to make sure people who sign into my app are also always signed into connected services like Firebase.

Thank you!