-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookies don't seem to get picked up within a chain or redirect requests #113
Comments
Thanks for the report! It looks like cookies are only saved for the first request in a redirect chain: Line 188 in 87b8a38
Will fix. |
An update on the above: I misread the code, and cookies are in fact saved on redirects after the first. I wrote a unittest (#127) to verify. Probably something else is going on. Are you able to share a sample of your code that triggered this problem so I can further debug? |
By the way, we had a bug until recently: #130. When multiple cookies were present, we would send multiple Cookie headers instead of just one. That could also explain this behavior, depending on whether multiple cookies were in use. |
Can this be closed? AIUI this is fixed, and has had no response from @mdirkse in a long time |
Hi, yeah, sorry for the radio silence, the code that showed this behavior hasn't been exercised in quite some time, so I'll close it for now and if I hit it again I'll post a more thorough reproducer. |
Hi,
I'm using ureq in a project to do ADFS authentication for AWS. The login mechanics basically work like this:
GET
the login page, which will set an auth-request cookiePOST
post credentials (along with the auth-request cookie)GET
s the redirect URL with the auth request and response cookie, to which the server replies with an HTML page that includes a form with SAML assertion that can be used to login to AWS.(If this sounds somewhat circuitous, it is, but that's how ADFS works.)
I was having trouble getting this to work with ureq. I'm using an
Agent
(for automatic cookie persistence) but the login procedure kept failing at step 4. On a hunch I usedredirect(0)
on thePOST
in step 2, extracted the cookies from the response and did the redirect request "manually" and things suddenly worked. This seems to indicate that cookies set during a request in a chain of redirects are not used in subsequent requests.The text was updated successfully, but these errors were encountered: