public CredentialValidationResult validate(UsernamePasswordCredential credential) { if (!(credential.getCaller().equals("test") && credential.getPassword().compareTo("pass"))) { return INVALID_RESULT; } return new CredentialValidationResult("test", new HashSet<>(asList("architect", "admin"))); }
public boolean compareTo(String callerName, String password) { return getCaller().equals(callerName) && getPassword().compareTo(password); }
public boolean compareTo(String callerName, String password) { return getCaller().equals(callerName) && getPassword().compareTo(password); }
public boolean compareTo(String callerName, String password) { return getCaller().equals(callerName) && getPassword().compareTo(password); }
public boolean compareTo(String callerName, String password) { return getCaller().equals(callerName) && getPassword().compareTo(password); }
public CredentialValidationResult validate(UsernamePasswordCredential usernamePasswordCredential) { Credentials credentials = callerToCredentials.get(usernamePasswordCredential.getCaller()); if (credentials != null && usernamePasswordCredential.getPassword().compareTo(credentials.password())) { return new CredentialValidationResult( new CallerPrincipal(credentials.callerName()), new HashSet<>(asList(credentials.groups())) ); } return INVALID_RESULT; }
public CredentialValidationResult validate(UsernamePasswordCredential usernamePasswordCredential) { Credentials credentials = callerToCredentials.get(usernamePasswordCredential.getCaller()); if (credentials != null && usernamePasswordCredential.getPassword().compareTo(credentials.password())) { return new CredentialValidationResult( new CallerPrincipal(credentials.callerName()), new HashSet<>(asList(credentials.groups())) ); } return INVALID_RESULT; }