-
-
Notifications
You must be signed in to change notification settings - Fork 379
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 with httponly #637
Comments
Well if you are using cookies then you don't need to pass a token since that's automatic. So basically, just setup a dummy driver that does nothing. https://websanova.com/docs/vue-auth/guides/drivers As for XSS, I guess you mean XSRF? For that you would pass a the xsrf token instead of an auth token, same idea as all the other drivers, just take a look. |
It is working if httponly false. At httponly true, authentication not work.
I mean that, any may JavaScript have access to token in localstorage or cookie (without httponly). |
Is there any update about this issue? |
In case anyone runs into this... tl;dr - If you're planning to use HTTPOnly cookies this library is probably overkill. All you likely need is an http interceptor to check for 401's and some router metadata to tag authenticated routes. However, you can probably get HTTPOnly cookies working with this and some caveats if you read on... There's a So your dummy driver has to be something like
};` A forewarning: it's probably not appropriate to use the default storage or cookie token store in a production application that has any sensitive data or where users can do sensitive things. The cookie storage mechanism (like all js cookie storage mechanism) is HTTPOnly so both it and local/session storage are vulnerable to XSS attacks. The common ways to prevent token stealing attacks if your application has an XSS vulnerability are HTTPOnly cookies, Web Workers or some form of in-memory tightly scoped storage, none of which are supported here. You can get something secure going by using HTTPOnly cookies and the 'storage' store but I'm not sure why you'd add an additional dependency for that. |
Hi, how to implement cookie from httponly? With set httponly, nothing works. Current implementation is susceptible to attacks XSS.
The text was updated successfully, but these errors were encountered: