美文网首页
secure a REST API

secure a REST API

作者: Zihowe | 来源:发表于2017-07-28 06:12 被阅读8次

    secure a REST API using Spring Security

    --

    • A REST API can be secured using Spring Security Java configuration. A good approach is to use form login with fallback to HTTP Basic authentication, and include some CSRF protection and the possibility to enforce that all backend methods are only accessible via HTTPS

    • This means the backend will propose the user a login form and assign a session cookie on successful login to browser clients, but it will still work well for non-browser clients by supporting a fallback to HTTP Basic where credentials are passed via the Authorization HTTP header.

    • Following OWASP recommendations, the REST services can be made minimally stateless (the only server state is the session cookie used for authentication) to avoid having to send credentials over the wire for each request.

    --

    相关文章

      网友评论

          本文标题:secure a REST API

          本文链接:https://www.haomeiwen.com/subject/cfqxlxtx.html