Skip to content

Commit

Permalink
add params filter for /api/token uri
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Sava <[email protected]>
Signed-off-by: Nigel Jones <[email protected]>
  • Loading branch information
bogdan-sava authored and planetf1 committed Mar 28, 2023
1 parent d0f7eae commit 96ddd02
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public AuthController(TokenService tokenService, AuthenticationManager authentic
this.authenticationManager = authenticationManager;
}

@PostMapping("/api/token2")
@PostMapping("/api/token")
public String token(@RequestBody LoginRequest userLogin) throws AuthenticationException {
Authentication authentication = authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(userLogin.username(), userLogin.password()));
return tokenService.generateToken(authentication);
}

@PostMapping("/api/token")
@PostMapping(value = "/api/token", params = {"username","password"})
public String token(@RequestParam String username, @RequestParam String password) throws AuthenticationException {
Authentication authentication = authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(username, password));
Expand Down

0 comments on commit 96ddd02

Please sign in to comment.