How to implement OAuth with glide app?

I am new to the glide app. I have written backend logic and endpoints to implement Oauth of 3rd party API. I have a button that will redirect the user to the OAuth login page and after successful login user will be redirected to the backend endpoint. After saving accessTokens of third-party API to the database via my backend server, I want to redirect to the glide app. Is this possible here?

Yes, it’s possible. I have an app that do it that exactly. I think that you only need to redirect your backend code to Glide App.
In my case, I have as last step, after saving tokens, the next code in PHP:

// We redirect the user to the webapp page
echo "<script>window.location.replace('" . WEBAPP_URL . "');</script>";

If you need more code, I will be happy to provide it to you.

I’ve glide mobile app. Should i use deep link for that?.

I haven’t tried that, but I think so. In my case, the redirect is to my PWA domain.
Attached, I’m sending you a video where we have implemented a Google API OAuth with Glide so you can see that it does work.

1 Like

This is my app url:
How can I add functionality where I will attach accessToken and refreshToken to URL. In my glide app side, I want to fetch these tokens to get third party data I saved in my database via backend server?.

@epdarias Can you guide me on above message please?

Hi @Haris_Abbasi !
In my case, I have a button to update my activity from Google Fit.

This button, insert a row in a Google Sheet with the necessary information (userID, accessToken, refreshToken…) to get data from Google Fit by access token.

In Google Sheet, I have a trigger “ON INSERTED” in order to read this new row.

My trigger check if access token is expired and I refresh it with the refresh token if is necessary.

This new access token is saved in Glide with a date time updated.
Screenshot at Sep 21 09-55-54

And with this access token, I can get data from Google Fit and I update info in Glide.

I hope this can help you a little :+1:t2:

Sorry, I forgot to tell you that I use App Script in Google Sheet in order to create all necessary code.