Announcement Announcement Module
Collapse
No announcement yet.
Authentication in AD and in the database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Authentication in AD and in the database

    Hi to all,

    This is my frist topic, I'm guessing the spring security fantastic and very complete.

    I have a question what would be the best way to implement the following scenario:

    1) To log into the application the system will check the user name and password in Active Directory, if the username and password are correct the system should search the database permissions registered for this user

    The name of the user in AD will be the same as the user name in the database.

    Can you give me any suggestions?

  • #2
    you'll need a role populator like this :

    Code:
    <bean id="user-details-authorities-populator" class="org.springframework.security.ldap.authentication.UserDetailsServiceLdapAuthoritiesPopulator">
    		<constructor-arg ref="user-details-service"/>
    	</bean>
    and some user service like :

    Code:
    <security:jdbc-user-service id="user-service" data-source-ref="ds-security" cache-ref="user-cache"
    		users-by-username-query="${user.query}"
    		authorities-by-username-query="${role.query}"
    	/>

    Comment

    Working...
    X