LDAP DNTemplate

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LDAP DNTemplate

shirkhan
Hi,

I'm using Shiro 1.3.2 and I got a problem with the User Dn Template at the DefaultLdapRealm.

I got an Microsoft Active Directory Server and want to login with the UID. So I set the template to "{0}", and login with "MYDOMAIN\my.name", which is working perfectly!

To simplify the login I wanted to add the domain (MYDOMAIN) the template. So I tried to set the user dn template to "MYDOMAIN\{0}".
But this is not working anymore ... I also tried "MYDOMAIN\\{0}" but this is also not working.

Is this parsing problem? Do I have to escape it?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: LDAP DNTemplate

Brian Demers
There are a lot of extra backslashes when viewing this post via email (directly on nabble seems looks fine)

This rings some bells for me, but it has been a while since I've messed with AD, but I'll throw up a couple thoughts:

- Try setting the template to " {0}@MYDOMAIN "
- I just wrote a quick (ugly) test to parse an INI file with the content of:
[main]
simpleBean = org.apache.shiro.config.SimpleBean
simpleBean.name = foobar\{0}
The value of `name` was correctly formatted.  Are you using a Shiro.ini file? or something else (Spring, Guice, etc?)






On Thu, Dec 1, 2016 at 7:56 AM, shirkhan <[hidden email]> wrote:
Hi,

I'm using Shiro 1.3.2 and I got a problem with the  User Dn Template
<https://shiro.apache.org/static/1.3.2/apidocs/org/apache/shiro/realm/ldap/DefaultLdapRealm.html#setUserDnTemplate-java.lang.String->
at the DefaultLdapRealm.

I got an *Microsoft Active Directory Server* and want to login with the
*UID*. So I set the template to "/{0}/", and login with
"/MYDOMAIN\my.name/", which is /*working perfectly*/!

To simplify the login I wanted to add the domain (/MYDOMAIN/) the template.
So I tried to set the user dn template to "/MYDOMAIN\{0}/".
But this is not working anymore ... I also tried "/MYDOMAIN*\\*{0}/" but
this is also not working.

Is this parsing problem? Do I have to escape it?

Thank you.



--
View this message in context: http://shiro-user.582556.n2.nabble.com/LDAP-DNTemplate-tp7581401.html
Sent from the Shiro User mailing list archive at Nabble.com.