今天下载 master 分支,部署成功之后,登陆后台报错,/login 接口返回【Invalid Base64 scheme】信息,定位代码类为【LoginAuthenticationConverter】下面方法有抛出异常
@Override
public Mono<Authentication> convert(ServerWebExchange exchange) {
return super.convert(exchange)
// validate the password
.flatMap(token -> {
var credentials = (String) token.getCredentials();
byte[] credentialsBytes;
try {
credentialsBytes = Base64.getDecoder().decode(credentials);
} catch (IllegalArgumentException e) {
// the credentials are not in valid Base64 scheme
return Mono.error(new BadCredentialsException("Invalid Base64 scheme."));
}
return cryptoService.decrypt(credentialsBytes)
.onErrorMap(InvalidEncryptedMessageException.class,
error -> new BadCredentialsException("Invalid credential.", error))
.map(decryptedCredentials -> new UsernamePasswordAuthenticationToken(
token.getPrincipal(),
new String(decryptedCredentials, UTF_8)));
});
}