I have an authentication procedure and I'm wondering if I'm not mixing up some concepts here. Basically:
Login:
- returns a signed JWT stored in memory with an hashed fingerprint as claim
- store httpOnly and Secure refresh token (JWT) on client with longer expiration time
- store fingerprint in secure httpOnly cookie
Authentication:
- Send a bearer access token via header
- Send XSRF token via header
- Verify retrieved XSRF token is valid in server
- retrieve fingerprint in server
- check in DB if refreshToken is valid
- verify access token validity and compare retrieved hashed fingerprint value with JWT fingerprint claim
Access token expired:
- check for CSRF token validity
- request a new token on refresh token route
- Check Refresh Token Validity
- Send new signed JWT access token with fingerprint
Does it sound enough for preventing both XSS and CSRF attacks (removing harmful html tag apart for XSS)?