#460 Code Review of an Authorization Controller

Companies:
Severstal
Themes:
SpringSpring SecurityCode Review

Perform a code review:

public class LoginParam {

    @NotNull
    private String username;

    @NotNull
    private String password;

}

@RestController
public class AuthController {
    public static final String LOGIN_PATH = "/login";

    private final AuthService authService;

    @PostMapping(LOGIN_PATH)
    public String login(LoginParam loginParam) {
        return authService.login(loginParam.getUsername(), loginParam.getPassword());
    }
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in