access modifiers and constructors fix
This commit is contained in:
@ -24,7 +24,7 @@ public class TokenController {
|
||||
|
||||
@GetMapping("/token")
|
||||
public ResponseEntity<String> getToken(@RequestParam("ticket") final String ticket) {
|
||||
CasValidator validator = new CasValidator(SERVICE_URL, ticket);
|
||||
final CasValidator validator = new CasValidator(SERVICE_URL, ticket);
|
||||
|
||||
try {
|
||||
String authority = validator.validate();
|
||||
|
@ -31,19 +31,11 @@ public class AuthenticationProvider extends AbstractUserDetailsAuthenticationPro
|
||||
protected UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication)
|
||||
throws AuthenticationException {
|
||||
|
||||
String token = authentication.getCredentials().toString();
|
||||
|
||||
User user = this.userService.getByToken(token);
|
||||
|
||||
if (user == null) {
|
||||
throw new UsernameNotFoundException("Cannot find user with authentication token=" + token);
|
||||
}
|
||||
|
||||
final String token = authentication.getCredentials().toString();
|
||||
User user = this.userService.getByToken(token)
|
||||
.orElseThrow(() -> new UsernameNotFoundException("Cannot find user with given authority"));
|
||||
UserDetails response = new UserDetails() {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user