I am trying the method in the answer here. Something like this:
url = 'https://InternalURL'
token = 'api token here'
response = redirect(url)
response['Token'] = token
return response
This code lives in a view that is called when clicking a link in a template. Some things are performed to build the correct url & get the api token prior to this code.
If I inspect the requests through Fiddler, the first redirect that has the 302 status code contains the headers I set. But the subsequent request that attempts to navigate to the actual url I want to redirect to, the headers I need are not set.
Obviously that results in the request failing since the authentication token doesn't exist in the header.
Am I completely missing something obvious? Is there a better way to do this? Thank you in advance for any help!