/** * Constructor for a VALID result. * * @param callerName Name of the validated caller * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String callerName, Set<String> groups) { this(new CallerPrincipal(callerName), groups); }
/** * Constructor for a VALID result. * * @param storeId Identity store unique ID * @param callerName Name of the validated caller * @param callerDn Caller's LDAP DN (distinguished name) * @param callerUniqueId Caller's unique identifier from the identity store * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String storeId, String callerName, String callerDn, String callerUniqueId, Set<String> groups) { this(storeId, new CallerPrincipal(callerName), callerDn, callerUniqueId, groups); }
/** * Constructor for a VALID result. * * @param callerName Name of the validated caller */ public CredentialValidationResult(String callerName) { this(new CallerPrincipal(callerName), null); }
/** * Constructor for a VALID result. * * @param callerName Name of the validated caller */ public CredentialValidationResult(String callerName) { this(new CallerPrincipal(callerName), null); }
/** * Constructor for a VALID result. * * @param callerName Name of the validated caller * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String callerName, Set<String> groups) { this(new CallerPrincipal(callerName), groups); }
/** * Constructor for a VALID result. * * @param callerName Name of the validated caller * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String callerName, Set<String> groups) { this(new CallerPrincipal(callerName), groups); }
/** * Constructor for a VALID result. * * @param callerName Name of the validated caller */ public CredentialValidationResult(String callerName) { this(new CallerPrincipal(callerName), null); }
/** * Constructor for a VALID result. * * @param storeId Identity store unique ID * @param callerName Name of the validated caller * @param callerDn Caller's LDAP DN (distinguished name) * @param callerUniqueId Caller's unique identifier from the identity store * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String storeId, String callerName, String callerDn, String callerUniqueId, Set<String> groups) { this(storeId, new CallerPrincipal(callerName), callerDn, callerUniqueId, groups); }
/** * Constructor for a VALID result. * * @param callerName Name of the validated caller */ public CredentialValidationResult(String callerName) { this(new CallerPrincipal(callerName), null); }
/** * Constructor for a VALID result. * * @param callerName Name of the validated caller * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String callerName, Set<String> groups) { this(new CallerPrincipal(callerName), groups); }
/** * Constructor for a VALID result. * * @param storeId Identity store unique ID * @param callerName Name of the validated caller * @param callerDn Caller's LDAP DN (distinguished name) * @param callerUniqueId Caller's unique identifier from the identity store * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String storeId, String callerName, String callerDn, String callerUniqueId, Set<String> groups) { this(storeId, new CallerPrincipal(callerName), callerDn, callerUniqueId, groups); }
/** * Constructor for a VALID result. * * @param storeId Identity store unique ID * @param callerName Name of the validated caller * @param callerDn Caller's LDAP DN (distinguished name) * @param callerUniqueId Caller's unique identifier from the identity store * @param groups Groups associated with the caller from the identity store */ public CredentialValidationResult(String storeId, String callerName, String callerDn, String callerUniqueId, Set<String> groups) { this(storeId, new CallerPrincipal(callerName), callerDn, callerUniqueId, groups); }
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; }
public CredentialValidationResult validate(UsernamePasswordCredential usernamePasswordCredential) { DataSource dataSource = getDataSource(); List<String> passwords = executeQuery( dataSource, dataBaseIdentityStoreDefinition.callerQuery(), usernamePasswordCredential.getCaller() ); if (passwords.isEmpty()) { return INVALID_RESULT; } if (hashAlgorithm.verify(usernamePasswordCredential.getPassword().getValue(), passwords.get(0))) { Set<String> groups = emptySet(); if (validationTypes.contains(ValidationType.PROVIDE_GROUPS)) { groups = new HashSet<>(executeQuery(dataSource, dataBaseIdentityStoreDefinition.groupsQuery(), usernamePasswordCredential.getCaller())); } return new CredentialValidationResult(new CallerPrincipal(usernamePasswordCredential.getCaller()), groups); } return INVALID_RESULT; }
public CredentialValidationResult validate(UsernamePasswordCredential usernamePasswordCredential) { DataSource dataSource = getDataSource(); List<String> passwords = executeQuery( dataSource, dataBaseIdentityStoreDefinition.callerQuery(), usernamePasswordCredential.getCaller() ); if (passwords.isEmpty()) { return INVALID_RESULT; } if (hashAlgorithm.verify(usernamePasswordCredential.getPassword().getValue(), passwords.get(0))) { Set<String> groups = emptySet(); if (validationTypes.contains(ValidationType.PROVIDE_GROUPS)) { groups = new HashSet<>(executeQuery(dataSource, dataBaseIdentityStoreDefinition.groupsQuery(), usernamePasswordCredential.getCaller())); } return new CredentialValidationResult(new CallerPrincipal(usernamePasswordCredential.getCaller()), groups); } return INVALID_RESULT; }