[Revert] Revert: Allow to pass password encoding in REST API Request
This commit is contained in:
parent
edac05f9d8
commit
b53a2d7009
|
@ -80,14 +80,8 @@ public class AuthenticationService {
|
||||||
String passwordEncoded = login.get("password").getAsString();
|
String passwordEncoded = login.get("password").getAsString();
|
||||||
|
|
||||||
byte[] decode = Base64.getDecoder().decode(passwordEncoded);
|
byte[] decode = Base64.getDecoder().decode(passwordEncoded);
|
||||||
String passwordString;
|
char[] password = new String(decode).toCharArray();
|
||||||
if (login.has("encoding") && !login.get("encoding").getAsString().isEmpty()) {
|
|
||||||
passwordString = new String(decode, login.get("encoding").getAsString());
|
|
||||||
} else {
|
|
||||||
passwordString = new String(decode);
|
|
||||||
}
|
|
||||||
|
|
||||||
char[] password = passwordString.toCharArray();
|
|
||||||
if (password.length < 3) {
|
if (password.length < 3) {
|
||||||
logger.error("Authentication failed: Password was not given or is too short!");
|
logger.error("Authentication failed: Password was not given or is too short!");
|
||||||
loginResult.addProperty("msg", MessageFormat.format("Could not log in due to: {0}",
|
loginResult.addProperty("msg", MessageFormat.format("Could not log in due to: {0}",
|
||||||
|
|
|
@ -280,12 +280,7 @@ public class PrivilegeUsersService {
|
||||||
|
|
||||||
String passwordEncoded = jsonObject.get("password").getAsString();
|
String passwordEncoded = jsonObject.get("password").getAsString();
|
||||||
byte[] decode = Base64.getDecoder().decode(passwordEncoded);
|
byte[] decode = Base64.getDecoder().decode(passwordEncoded);
|
||||||
String passwordString;
|
String passwordString = new String(decode);
|
||||||
if (jsonObject.has("encoding") && !jsonObject.get("encoding").getAsString().isEmpty()) {
|
|
||||||
passwordString = new String(decode, jsonObject.get("encoding").getAsString());
|
|
||||||
} else {
|
|
||||||
passwordString = new String(decode);
|
|
||||||
}
|
|
||||||
|
|
||||||
ServiceHandler svcHandler = RestfulStrolchComponent.getInstance().getComponent(ServiceHandler.class);
|
ServiceHandler svcHandler = RestfulStrolchComponent.getInstance().getComponent(ServiceHandler.class);
|
||||||
PrivilegeSetUserPasswordService svc = new PrivilegeSetUserPasswordService();
|
PrivilegeSetUserPasswordService svc = new PrivilegeSetUserPasswordService();
|
||||||
|
|
Loading…
Reference in New Issue