Spring security framework focuses on providing both authentication and authorization in java applications. It also takes care of most of the common security vulnerabilities such as CSRF attack. It’s very beneficial and easy to use Spring security in web applications, through the use of annotations such as @EnableWebSecurity.