Reputation: 1335
I am working on a java web project where a manager logs into a system and then completes activities on behalf his subordinates. Depending on what AD security group the subordinate belongs to an email may be sent for notification purposes. I am looking for a java 'hasRole' function that will allow me to pass a network id and security group name as parameters and return a boolean to indicate the membership in the group. The app is currently using UserPrincipal to authenticate and check for group membership but this requires user credentials. I would need to connect to AD via a service account then check for membership at that point. Has anyone seen anything like this before? All I have found online are ones simliar to my current setup that only check for the user with the active session.
Upvotes: 0
Views: 539
Reputation: 18415
You can inspect the source code of my Tomcat ActiveDirectoryRealm
. I does exactly what you are looking for.
Upvotes: 1