1 Answer
- Newest
- Most votes
- Most comments
3
Yes, in view of security as priority, compare to local vs. cookies with secure transaction say HTTPS.
For Amplify Gen 2:
Amplify.configure({
ssr: true // Enables cookie storage for authentication tokens
});
For Amplify Gen 1:
import { CookieStorage } from 'aws-amplify/utils';
import { cognitoUserPoolsTokenProvider } from 'aws-amplify/auth/cognito';
cognitoUserPoolsTokenProvider.setKeyValueStorage(new CookieStorage());
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
Thanks for your response! The tokens become cookie storage now. But this is not HttpOnly (like the picture below), still a possibility of an XSS attack. Do you have an idea to enable HttpOnly cookies? i have read this documentation( https://docs.amplify.aws/nextjs/build-a-backend/server-side-rendering/#experimental-perform-authentication-on-the-server-side-and-enable-httponly-cookies ), But it seems only for Managed login feature. I appreciate your assistance!