concept term in category spring

appears as: terms, terms
Spring Security in Action

This is an excerpt from Manning's book Spring Security in Action.

Generally, as developers, we start by learning that the purpose of an application is to solve business cases. This purpose refers to something where data could be processed somehow, persisted, and eventually displayed to the user in a specific way as specified by some requirements. This overview of software development, which is somehow imposed from the early ages of learning development, has the unfortunate disadvantage of hiding practices that are also part of the process. While the application works correctly from the user’s perspective, and in the end, it does what the user expects in terms of functionalities, there are lots of aspects hidden in the final result.

Non-functional software qualities such as performance, scalability, availability, and (of course) security, as well as others, may have an impact over time, from short to long term. If not taken into consideration early on, these qualities can affect in terms of profitability the owners of the application dramatically. Moreover, they could trigger failures in other systems as well (for example, by the unwilling participation in a distributed denial of service (DDoS) attack). The hidden aspect of non-functional requirements (the fact that it’s much more challenging to see if they’re missing or incomplete) makes them, however, more dangerous.

The purpose of the encode(CharSequence rawPassword) method is to return a transformation of a string provided. In terms of Spring Security functionality, it will be used to provide encryption or hash for a given password. You can use the matches(CharSequence rawPassword, String encodedPassword) afterward to check if an encoded string matches a raw password. You use the matches() method in the authentication process to test a provided password against a set of known credentials. The third method, called upgradeEncoding(CharSequence encodedPassword), defaults to false from the contract. If overridden to return true, then the encoded password is encoded again for better security.