tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat Realm/LDAP - userRoles and Organization Unit name for authenticated users
Date Tue, 13 Dec 2016 22:26:29 GMT
Hash: SHA256


On 12/5/16 12:25 PM, Taylor, Larry wrote:
> If isUserinRole  has information to make determination to
> different component accesses in the application that would be
> sufficient - although,  what I  really need to know is what
> department or Organizational unit they belong to after
> authentication in order to give them specific page component
> accesses.

What if they belong to multiple organizational units or departments?

Usually a user has multiple roles but only one CN, and certainly only
one DN. Are you taking the CN/DN and removing some of it in order to
obtain the user's "username"? If so, don't do that and use their whole
CN/DN as their username and then parse it yourself to determine their
organization unit, etc.

As it stands, Tomcat's LDAP authenticator only provides two pieces of
information that is visible to the application: username and
(indirectly) list of roles.

You might want to make another connection to your directory to look-up
any additional information on that user to complete the set of
metadata you want to use to customize the UI for each user.

Hope that helps,
- -chris

> -----Original Message----- From: Felix Schumacher
> [] Sent: Sunday, December
> 04, 2016 2:17 AM To: Subject: Re: Tomcat
> Realm/LDAP - userRoles and Organization Unit name for authenticated
> users
> Am 04.12.2016 um 08:04 schrieb Taylor, Larry:
>> Hello,
>> For  Users that have authenticated  from the Web Login page
>> through Tomcat Realm LDAP configuration is it possible to get the
>> authenticated user's ou=Organizational Unit or Department name?
>> and also what their role names are?   I need this information to
>> pass to a servlet or jsp page.
>> I saw documentation about the class but
>> could not find any documentation or examples on how to get this
>> type of information after users are authenticated.
>> I am able to get the username with
>> ${} &
>> request.getRemoteUser(); but nothing about how to get the user's
>> member affiliations and roles.
> The standard way to get the roles is to iterate over your expected
> roles and ask for request.isUserInRole(role). The servlet spec has
> no API to get directly a list of roles.
> If you are willing to bind yourself to the implementation of
> JNDIRealm you could get the list of roles. But I don't recommend
> it, as that implementation is not guaranteed to stay stable.
> Do you really need to get the list, or is isUserInRole enough?
> Regards, Felix
>> Any information or pointers on this is appreciated.
>> ________________________________ Larry Taylor
> ---------------------------------------------------------------------
To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
To unsubscribe, e-mail:
> For additional commands, e-mail:
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message