question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CookieStorage with httpOnly

See original GitHub issue

** Which Category is your question related to? ** Auth

** What AWS Services are you utilizing? ** Cognito

** Provide additional details e.g. code snippets ** I’m using Amplify with my React app and would like to secure my API using JWTs (not using AWS API Gateway).

Is it possible to use Amplify Auth with CookieStorage and httpOnly? I’d like to prevent XSS with the httpOnly flag but looking at the interface for ICookieStorageData it looks like this isn’t supported. Is it even possible to add support for this?

Alternatively what’s the recommended authentication configuration/flow from a security perspective? I’ve seen the doc mention things like localStorage but from my understanding it’s not secure from a XSS perspective.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:42
  • Comments:27 (5 by maintainers)

github_iconTop GitHub Comments

43reactions
mmmmcakecommented, Jun 11, 2019

I would just like to say that this issue is one of the biggest reasons my company is considering the removal of Cognito from our stack (and not being able to set session expiration for less than a day). If there’s anything I can do to elevate the priority of this issue, let me know because I’d love to avoid the pain of migrating away.

26reactions
altin-selimicommented, May 5, 2019

Im very surprised this is the only issue in this repo I’m finding regarding the security of a web app using Amplify.

LocalStorage (which seems to be currently used) is definitely not secure from XSS attacks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HttpOnly Cookies with AWS Cognito - Stack Overflow
The CookieStorage object only takes domain, path, expires, and secure configurations. Is it possible to configure the authentication response to ...
Read more >
AWS Cognito with HttpOnly Cookie - Medium
AWS Services are great, but around cognito there isn't a clear documentation or indications when it comes to HttpOnly cookies.
Read more >
A secure http only cookie based approach to using AWS Amplify
This library was created the address the issues found here. Basically this will avoid using client side cookies and local storage by using ......
Read more >
CookieStorage (JxBrowser 6.23.1 API) - TeamDev
Deletes one specific cookie . int, deleteAll(). Deletes all of the cookies including session, secure or HTTP only cookies. java ...
Read more >
Using HTTP cookies - MDN Web Docs
For example, cookies that persist in server-side sessions don't need to be available to JavaScript and should have the HttpOnly attribute. This ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found