Welcome to the community, @Ofir_Sudai! Thanks for reaching out.
Does this mean that you have a non-Retool server handling the verification of that token? If that's the case (and if you're on a Business plan) I'd probably recommend storing the token as a user attribute via the corresponding API endpoint. That would allow you to reference current_user.metadata.TOKEN_NAME when configuring your resources.
Do you think that might work for your use case? Let me know if you have any questions!
Yes, we have a non retool backend. I was thinking to do the following:
create a base resource with "custom auth:" authentication with the following auth flow:
Oauth2 (Generic) - this will return the google token information
API Request - this will verify the google token infomration and generate our own temporary jwt access token
Define a variable - store the access token as a variable to be used
I was able to verify its working when testing the auth flow.
The current issues im facing:
When using the resources, the auth flow isn't actually triggered and we always get an 401 from our server. I was expecting the auth flow to be triggered every time. Is this because we are not on the enterprise plan?
I am not sure I understand how to handle our access token expiration. either because the auth flow will run everytime then it doesn't matter as the access token will keep refreshing or i need a way to detect that the token is expired (based on a response from our server maybe or whenever there is an error) and trigger a reauth.
The only alternative i can think of is introduce a "login" button on my app that will save the access token as a magic variable and then just reference it any of the other resources.