I'm following Custom API authentication doc for setup custom auth in my retool application. Everything is working fine, except step 5 " Saving the Authentication Token". I'm trying to set a variable name PASSWORD from my response JSON but it's always showing undefined. I've tries multiple ways to access it but every time it reacts the same.
Hey @tacenda and welcome to the forum! Thanks for the detailed screenshots.
Have you tried {{ http1.body.data.token }}? (or .name, not sure which you’re trying to extract). We might have erred in the docs there by putting .json instead of .data.
Hi @justin, Thanks for your reply.
Yes, I have tried {{ http1.body.data.token }} and I also tried some combinations with http2 instead of http1 but every time it sets undefined in password. When I set a hardcoded value then it works fine.
@tacenda very strange. It does seem like you’re following the docs pretty much word for word, I’m not sure what the issue is. Could you attach a screenshot of the whole custom auth flow that you’ve built so I can see all of the steps?
I was tried to set a hardcoded value for PASSWORD under Define a variable and it put that value in header successfully but unable to set from login response. https://prnt.sc/whjkv4
@tacenda thanks!! I think the issue might be that you’re missing a step in the custom auth workflow - seems like you have two steps defined, and then a refresh step, where you’re defining your variable. Can you move the “define a variable” step to the workflow itself? It should be the third step, right after you make your POST request with the username and password.
I have the same exact issue. I utilize my resource in a shared query and it works properly (Confirming that my resource set up is correct). However, once I attempt to use that query in an app, it fails. Using the resource directly in the App fails as well. From my investigation, it looks like the variable from my resource is not being passed when I make the API call within the App. Can someone please look into this and assist as this is a significant blocker.
Hey @rononiwu! So it works in a query library query, but not in a standalone query? Would you mind sharing a screenshot of your resource setup page, as well as any specific errors you're getting?