Results 1 to 3 of 3

Thread: Just a quick one

  1. #1
    Join Date
    Oct 2012
    Posts
    11

    Default Just a quick one

    Hi Guys,

    Is there a way (using Spring Security 3.1+) to associate a particular intercept-url with a particular authentication-provider (ultimately a specific userDetailsService), for example is it possible to have something like this:


    Code:
         <security:http use-expressions="true">
    		<security:intercept-url pattern="/URL1/**"
    			access="hasRole('ROLE1')" />
    	</security:http>
    
            <security:http use-expressions="true">
    		<security:intercept-url pattern="/URL2/**"
    			access="hasRole('ROLE2')" />
    	</security:http>
    
    
    	<security:authentication-manager>
    		<security:authentication-provider
    			ref="role1Provider" />
    	</security:authentication-manager>
    
            <security:authentication-manager>
    		<security:authentication-provider
    			ref="role2Provider" />
    	</security:authentication-manager>
    to have each url pattern be authenticated with its respective 'provider' ?!

    I searched on the net without success, I also had a look at the 'security' schema (unless I have missed out on something obvious) there doesn't appear to be an obvious link for associating one with another.

    If such an explicit link doesn't exist how would one go about solving this type of problem?

    All ideas are welcome.

    Regards,


    M.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    I suggest a read of the reference guide...

    The http element can contain a reference to a specific authentication-manager (attribute authentication-manager-ref). You also need to specify an id for each authentication-manager else one overrides the other.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Oct 2012
    Posts
    11

    Default

    Quote Originally Posted by Marten Deinum View Post
    I suggest a read of the reference guide...

    The http element can contain a reference to a specific authentication-manager (attribute authentication-manager-ref). You also need to specify an id for each authentication-manager else one overrides the other.
    Thanks for your quick response.

    M.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •