Spring Security Token Authentication - RESTful JSON Service

后端 未结 3 1899
感动是毒
感动是毒 2021-01-30 00:40

I\'m looking to use Spring Security for a Spring MVC application which will strictly be a JSON web service. I\'ve done some research and read a few articles but haven\'t really

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 01:02

    "I want the application to be completely stateless"

    I'd reconsider what you're trying to do. There's a reason why you can't find good examples of your solution: You simply can't have an application that's both stateless and secure. Also if you're storing the tokens somewhere, you're not being stateless. Even if you aren't storing the tokens (like using JWT to encode them), you have to protect against CSRF attacks if users will be accessing this in a web browser. If you do go your route, expect to be writing a lot of customized security code (which is a bad thing). See a discussion of this here: https://spring.io/blog/2015/01/12/the-login-page-angular-js-and-spring-security-part-ii

提交回复
热议问题