Refresh token not working
I have set up an HTTP connection with token authentication and have configured a refresh token that should refresh every 2 hours(because token expires every 2 hours). In the refresh token box I have filled in a wrong dummy token in the token input box and correctly filled in the relative URI and HTTP request body. The path to token field has been set to "token" because this is where I receive the new token, which is in the following format: {token:"newtoken"}.
In my HTTP flow step, I have configured the HTTP header with the token, {{connection.http.auth.token.refreshToken}}. When I perform a test connection from the connection in Integrator, it successfully posts to the relative URI endpoint of the refresh token box and fetches a new token. However, when I perform a post from in HTTP flow step, I receive a response with a status code 401 and the error message "api authentication failed". It appears that my refresh token is not working as expected, as the endpoint receives the dummy token that I had filled in manually instead of performing a post to fetch a new token.
What could I be doing wrong?
-
Nuri Ensing could you send some screenshots? If your token needs to be sent in the header, then you can specify that on the connection settings without having to use handlebar expressions. If you continue using the handlebar expression, then you probably need to use {{connection.http.auth.token.token}} because the connection will automatically store a new token after performing the refresh task. The "refreshToken" is used when performing the refresh token call, but the response from that call updates that actual token.
0 -
Nuri Ensing the downside of using the handlebar expression is you'll have to specify it on every import and export step. If you modify the connection settings to say the token belongs in the header, then you won't have to specify it on every export or import.
0 -
Tyler Lamparter
Screenshot HTTP import step:
Screenshot connection:
and:
When doing a POST in Postman to the signin api with the same http request body i do get a json response back which looks something like this:{"token":"removed","user":{"id":"6",
etcetera.....
0 -
Nuri Ensing can you try not specifying your headers on your import step? By doing that, you're basically duplicating or overriding the connection level settings that will already put the token in the header for every call to that connection.
0 -
Tyler Lamparter Thanks. However I already did that one and now yet again but I am still getting the same problem.
0 -
Nuri Ensing it may be easier to troubleshoot over zoom. We have office hours every Tuesday, could you join next week? https://docs.celigo.com/hc/en-us/articles/360045798291
0 -
I have submitted a ticket as this is a problem in production which needs to be fixed.
0
Please sign in to leave a comment.
Comments
7 comments