Can you access the browser cookies and forward them in your API request?

I am using a custom Auth by redirecting to our custom SSO. The SSO is in turn redirecting to google authentication with a redirect url back to retool app page. It sends along with it, cookies containing authentication token. I want to send these tokens along with the API request. Is there a way to do this? I want to ask whether we could send the authentication token with every request automatically or save the token to a temporary state or variable and add it manually to every API request made.

I did try to access the browser's cookies using document.cookies but it gives an error "Failed to read the 'cookie' property from 'Document': The document is sandboxed and lacks the 'allow-same-origin' flag."

1 Like

Hey @srikrishnas we have some great documentation on Cookie Based APIs that I think will work great with your use case. You can find the documentation here. Let me know if this helps. Thank You!

1 Like