CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2020-08-26
by Aspian

Original Post

Original - Posted on 2020-08-26
by Aspian



            
Present in both answers; Present only in the new answer; Present only in the old answer;

**Store your access token in memory and store your refresh token in the cookie**
**Why is this safe from CSRF?**
Although a form submit to `/refresh_token` will work and a new access token will be returned, the attacker can't read the response if they're using an HTML form. To prevent the attacker from successfully making a fetch or AJAX request and read the response, this requires the Authorization Server's CORS policy to be set up correctly to prevent requests from unauthorized websites.
You can read more about it here:
https://dev.to/cotter/localstorage-vs-cookies-all-you-need-to-know-about-storing-jwt-tokens-securely-in-the-front-end-15id
**Store your access token in memory and store your refresh token in the cookie**
**Why is this safe from CSRF?**
Although a form submit to `/refresh_token` will work and a new access token will be returned, the attacker can't read the response if they're using an HTML form. To prevent the attacker from successfully making a fetch or AJAX request and read the response, this requires the Authorization Server's CORS policy to be set up correctly to prevent requests from unauthorized websites.
You can read more about it here:
https://dev.to/cotter/localstorage-vs-cookies-all-you-need-to-know-about-storing-jwt-tokens-securely-in-the-front-end-15id

        
Present in both answers; Present only in the new answer; Present only in the old answer;