The salt and token are now calculated at each new access starting from the password saved in the database, based on the type of access

This commit is contained in:
CappielloAntonio 2022-02-05 23:33:08 +01:00
parent cc9afb8057
commit d408b82503
4 changed files with 38 additions and 38 deletions

View file

@ -115,14 +115,15 @@ public class Subsonic {
public Map<String, String> getParams() {
Map<String, String> params = new HashMap<>();
params.put("u", preferences.getUsername());
params.put("s", preferences.getAuthentication().getSalt());
params.put("t", preferences.getAuthentication().getToken());
if (preferences.getAuthentication().getPassword() != null) params.put("p", preferences.getAuthentication().getPassword());
if (preferences.getAuthentication().getSalt() != null) params.put("s", preferences.getAuthentication().getSalt());
if (preferences.getAuthentication().getToken() != null) params.put("t", preferences.getAuthentication().getToken());
params.put("v", getApiVersion().getVersionString());
params.put("c", preferences.getClientName());
params.put("f", "xml");
if (preferences.getPassword() != null && !preferences.getPassword().trim().equals("")) params.put("p", preferences.getPassword());
return params;
}
}