Commit 42ac6905 by Tuomas Riihimäki

Argh.. noobie error ( == when should have been .equals

1 parent 49056db1
...@@ -47,7 +47,7 @@ public class BasicAuthPBean extends ApiAuth implements AuthenticationFormat { ...@@ -47,7 +47,7 @@ public class BasicAuthPBean extends ApiAuth implements AuthenticationFormat {
} }
String authStr = new String(Base64.getDecoder().decode(pwdsplit[1]), UTF8); String authStr = new String(Base64.getDecoder().decode(pwdsplit[1]), UTF8);
String[] splitStr = authStr.split(PASSWORD_DELIMITER); String[] splitStr = authStr.split(PASSWORD_DELIMITER);
if (splitStr.length != 4 && splitStr[0] != PASSWORD_PREFIX) { if (splitStr.length != 4 || !PASSWORD_PREFIX.equals(splitStr[0])) {
logger.warn( logger.warn(
"Invalid Basic authentication string '{}'. Authstring must start with {}, followed by appid and app pass", "Invalid Basic authentication string '{}'. Authstring must start with {}, followed by appid and app pass",
authStr, PASSWORD_PREFIX); authStr, PASSWORD_PREFIX);
...@@ -58,7 +58,7 @@ public class BasicAuthPBean extends ApiAuth implements AuthenticationFormat { ...@@ -58,7 +58,7 @@ public class BasicAuthPBean extends ApiAuth implements AuthenticationFormat {
final String appKey = splitStr[3]; final String appKey = splitStr[3];
ApiApplicationInstance appInstance = verifyAppInstance(appId, userId); ApiApplicationInstance appInstance = verifyAppInstance(appId, userId);
if (appKey != null && !appKey.isEmpty() && appKey.equals(appInstance.getSecretKey())) { if (appInstance != null && appKey != null && !appKey.isEmpty() && appKey.equals(appInstance.getSecretKey())) {
ret.setUsername(getUsername(appInstance)); ret.setUsername(getUsername(appInstance));
} }
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!