The authentication response is now in the correct format and initially was being accepted but now it seems like the issue might be in the checking of the token and expiry date. Is there a way to be able to see deeper into that connection process to be able to determine where the issue might be?
Custom oauth2 doesn’t need to refresh token. Bubble will get a new token on each call. It’s normally used for client_credentials that, in most case, doesn’t use the refresh token.
Hmmm… interesting. The behavior I’m experiencing is that it works for awhile and then I start getting invalid token as a response after a few minutes. If it is getting a new token each time, I wouldn’t expect that to happen. I’ll likely just have to set up my own system to handle it at this point.
So it worked to initialize a simple GET endpoint, which I was using on a page, but then it started to get a 400 with an “invalid token” response from the server
I’ve made some test, and I think that Bubble will also refresh token if needed. Is the endpoint for refresh token is the same to get token? This is normally the good way to work. The grant_type received by this endpoint should be refresh_token.
Yeah I think this is the reason it’s not working properly. The endpoint for refreshing the token is /refresh_token whereas the initial token endpoint is /session_tokens. I will just set up a manual handler for this then. Seems like it’s not going to be straightforward to let Bubble handle it
One thing I’m not sure I understand is that why is bubble trying to refresh the token long before it needs to? The expiration timestamp seems to suggest the token is good for a day.