cybertooth-io / ermahgerd-rails-api-jwt

Rails 5+ API, JWT_Session, Pundit, JSONAPI, Sidekiq, PostgreSQL.
0 stars 0 forks source link

Choose Your Authentication Adventure #12

Closed nadnoslen closed 5 years ago

nadnoslen commented 5 years ago

Cookie stored access tokens combined with a CSRF token is the safest form of session management combined with JWT because you are completely resilient from XSS attacks. Request forgery attacks are mitigated by CSRF token. See CookieAuthenticationsController & RefreshCookiesController.

An access token can be willfully passed down to your client application, but it is not recommended to use this technique for web pages or SPAs. See TokenAuthenticationsController & RefreshTokensController.

All of these new controllers are well tested. All classes have detailed class comments.

See issue #8