Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

Obtain permission for the user name in the header for spring security

$
0
0

I need to implement spring security for my api-controller.

-> Each page should contain a header with username (like in Siteminder?).

-> Every user has been already registered in SpringConfiguration

@Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { ... gets all users from database with their authorities }

-> For every page it's configured, which authorities a user should have

@Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("**/Pagename/**").hasAuthority("authorityName"); }

I cannot understand now, what should I add to make the program read a username from page header. RequestHeaderAuthenticationFilter? Another kind of filter?

The other question is if you could give me a link to tutorial/examle how to build it in without using XML.


Viewing all articles
Browse latest Browse all 12749

Trending Articles