Skip to content
Browse files

fixes issue #14: login french user

  • Loading branch information...
1 parent cf15ea0 commit 18f62d2c34c89882d28c87fbb07deb7078b925dc @michaelschuetz committed Apr 16, 2012
View
20 ...ore/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java
@@ -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);
}

0 comments on commit 18f62d2

Please sign in to comment.
Something went wrong with that request. Please try again.