<div dir="ltr">On Sun, Apr 28, 2013 at 5:58 PM, Juan Mucarquer <span dir="ltr"><<a href="mailto:juan.mucarquer@alumnos.usm.cl" target="_blank">juan.mucarquer@alumnos.usm.cl</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>Hello,<br>
<br></div>I'm using vt-ldap in order to login users. The problem is there are duplicate UIDs in the LDAP, but in different OUs. <br><br>For example exists:<br>uid=john.doe,ou=people,dc=university,dc=edu<br>
</div>uid=john.doe,ou=students,dc=university,dc=edu<br clear="all"><div><div><div><div><div><div><div><br></div><div>In login.config, the userFilter is set by default:<br><br></div><div>userFilter=(uid={0})<br></div><div>
<br></div><div>Where {0} is the uid supplied in the AuthUserPassLoginPage (login.jsp). <br><br>As I'm reading in the vt-ldap documentation, its possible to pass another argument to the login module (userFilterArgs). Thats my question, how I can pass the OU argument ({1}) from the login.jsp, in order to login users like userFilter=(uid={0},ou={1})?<br>
<br></div><div>Currently, I cannot login users where this happens, due to the search returns multiple DNs, and tries to login with the first it finds.</div></div></div></div></div></div></div></div></blockquote><div><br>
</div><div style>You could pass the userId to the LoginHandler containing both the userId and the ou argument, perhaps like 'juan@students"</div><div style>Then you could write a custom DN resolver to split the userId and inject the argument: <a href="https://github.com/dfish3r/sandbox/blob/master/vt-ldap/CustomDnResolver.java">https://github.com/dfish3r/sandbox/blob/master/vt-ldap/CustomDnResolver.java</a></div>
<div style>Lastly, set the resolver in your login.config like so: dnResolver="CustomDnResolver"</div><div style>A filter of (&(uid={0})(ou={1})) should then format properly.</div><div style><br></div><div style>
--Daniel Fisher</div><div style><br></div></div></div></div>