Handling both form and HTTP basic authentication with different sources

后端 未结 2 1738
鱼传尺愫
鱼传尺愫 2020-12-15 12:07

I already have form login and Basic auth working side by side with the help of a DelegatingAuthenticationEntryPoint.

What I\'m trying to do is have users coming thru

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 12:56

    Depending on your app and whether you're using Spring Security 3.1, you might be best to split the configuration into multiple filter chains, each with a separate authentication manager defined:

    
        
    
    
    
        
    
    
    
        
    
    
    
        
    
    

    Instead of the pattern attribute you can also use the request-matcher-ref attribute to specify a RequestMatcher instance which will be used to map incoming requests to a particular filter chain. This has a very simple interface, but can allow you to match based on something other than the URL path, such as the Accept header.

提交回复
热议问题