Skip to content

Commit

Permalink
fixes issue techatspree#14: login french user
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelschuetz committed Apr 16, 2012
1 parent cf15ea0 commit 18f62d2
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1295,17 +1295,23 @@ public boolean validateCredential(IdentityStoreInvocationContext ctx, IdentityOb
{
try
{
IdentityStore toStore = resolveIdentityStore(identityObject);
IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, ctx);

if (hasIdentityObject(targetCtx, toStore, identityObject))
// check attributes for all ldap stores
for (String storeName : attributeStoreMappings.keySet())
{
return toStore.validateCredential(targetCtx, identityObject, credential);
}

targetCtx = resolveInvocationContext(defaultIdentityStore, ctx);
IdentityStore userIdentityStore = resolveIdentityStore(new SimpleIdentityObjectType(storeName));
IdentityStoreInvocationContext otherLdapCtx = resolveInvocationContext(userIdentityStore, ctx);
SimpleIdentityObject userIdentityForStore = new SimpleIdentityObject(identityObject.getName(), identityObject.getId(), new SimpleIdentityObjectType(storeName));
if (hasIdentityObject(otherLdapCtx, userIdentityStore, userIdentityForStore))
{
boolean credentialsValid = userIdentityStore.validateCredential(otherLdapCtx, userIdentityForStore, credential);
if (credentialsValid) return true;
}
}
IdentityStoreInvocationContext targetCtx = resolveInvocationContext(defaultIdentityStore, ctx);

if (toStore != defaultIdentityStore && hasIdentityObject(targetCtx, defaultIdentityStore, identityObject))
if (hasIdentityObject(targetCtx, defaultIdentityStore, identityObject))
{
return defaultIdentityStore.validateCredential(targetCtx, identityObject, credential);
}
Expand Down

0 comments on commit 18f62d2

Please sign in to comment.