-
Notifications
You must be signed in to change notification settings - Fork 47
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
Cookie authentication not properly working #525
Comments
The cookie was set with a fixed path so there could only be one The only edge case which I'm seeing is that you've added the
No it may not, assigning to |
Your last commit is called See also: atomicdata-dev/atomic-data-browser#253 |
Since cookies don't change every request, the subject in question is a constant containing the server url. From what I recall is that the solution we came up with was that the root subject should be valid for all the children as well. |
Looks like there's still something wrong with the cookie parser, it's still signing in as Also: why is there a |
I've added a test (single cookie value at the moment) and improved error handling. Now I still need to add a failing test for the google analytics cookies, but then I first need to actually set these here. |
Another case we should handle: what if the user has multiple
Two domains, two cookies. Now the server will receive two cookies, and will parse the first one, leading to an error:
So how should we deal with this? Server handles multiple cookiesIf there is a subject mismatch, check if there is another cookie. This means we update the Client removes existing cookieWe set cookies on top level domain only |
I've made the server try all the cookies |
In the current release, I get a
401
after opening my drive. The error from the server shows that it has not found an Agent, which should imply there is no cookie set. However, there is in fact a cookie sent.I'm not sure why this isn't working, but I suspect that one of the functions in the cookie parse logic is throwing an error which is thrown away with
.ok()
, which makes it impossible to see what is going on. So even though I'm not sure what is causing the issue, a good first step would be to refactorget_auth_from_cookie
and make sure it gets rid of the.ok
calls.The reason I think the parsing fails, is because in production, we have multiple cookies. Google analytics is probably responsible for setting the multiple cookies. Our implementation should deal with this.
Using
actix_web::cookie
might be a good idea.However, even if we update the back-end, we might still have an issue with atomic-data-browser. When it sets the cookies, it may remove others (e.g. google analaytics)<- That is false.The text was updated successfully, but these errors were encountered: