私は春のセキュリティに対して非常に新しいです。私はJWT
フィルターを私のWebアプリケーションに実装してステートレスにしようとしています。私は、コードの一部、ユーザーが/login
パスに当たったとき、制御がメソッドになり、SpringブートWebアプリケーションでのJWTフィルタとスプリングのセキュリティ制御フロー
public LoginResponse login(
AuthenticationRequest authenticationRequest, Device device)
throws WebappException
{
// Perform the security
final Authentication authentication = authenticationManager
.authenticate(new
UsernamePasswordAuthenticationToken(authenticationRequest.getUsername(),
authenticationRequest.getPassword()));
SecurityContextHolder.getContext().setAuthentication(authentication);
/** some more logic**/
ここで私は私を導いてください final Authentication authentication = authenticationManager .authenticate(new UsernamePasswordAuthenticationToken(authenticationRequest.getUsername(), authenticationRequest.getPassword()));
の目的を理解していないですがあります! AuthenticationRequest
には、2つのフィールドuserName
とpassword
があります。
https://www.toptal.com/java/rest-security-with-jwt-spring-security-and-javaの 詳細についてはどのように '最終認証認証= authenticationManager .authenticate(新しい UsernamePasswordAuthenticationToken(authenticationRequest.getUsername()、 authenticationRequest.getPassword()));'ユーザ名とパスワードのチェックを行い、?私は単に、ユーザーがリクエストに投稿した内容を渡しています。データベース内のデータに対してどのように検証されますか? –