spring-security

Problem with permitAll in Vaadin and WebSecurity - not working

人盡茶涼 提交于 2021-02-10 18:39:52
问题 I have few views made in Vaadin by @Route and now I want to add Security and some Login. In my SecurityConfiguration class I'm setting antMatchers.permitAll() only for 2 views and for the rest with Role ADMIN . But it is not working as I think it should. It demands login to access every view, and after login I have access to all views no matter what role has the user. I hoped this tutorial will help me, but in there are no views accessible without login. Securing Your App With Spring Security

Configure Spring Security for multiple login pages in a Spring Boot application

末鹿安然 提交于 2021-02-10 11:53:19
问题 @Configuration public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private AccessDeniedHandler accessDeniedHandler; @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable() .authorizeRequests() .antMatchers("/", "/home", "/about").permitAll() .antMatchers("/admin/**").hasAnyRole("ADMIN") .antMatchers("/user/**").hasAnyRole("USER") .anyRequest().authenticated() .and() .formLogin() .loginPage("/login") .permitAll() .and()

Configure Spring Security for multiple login pages in a Spring Boot application

旧巷老猫 提交于 2021-02-10 11:50:06
问题 @Configuration public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private AccessDeniedHandler accessDeniedHandler; @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable() .authorizeRequests() .antMatchers("/", "/home", "/about").permitAll() .antMatchers("/admin/**").hasAnyRole("ADMIN") .antMatchers("/user/**").hasAnyRole("USER") .anyRequest().authenticated() .and() .formLogin() .loginPage("/login") .permitAll() .and()

Spring Boot OAuth2, with Tomcat and nginx get error ERR_TOO_MANY_REDIRECTS after authenticate

泄露秘密 提交于 2021-02-10 06:52:37
问题 I have a Spring Boot application, it use OAuth2 authentication from WSO2 Identity Server. When I run the aplication on Spring Tool Suit, it works, so i can sing in and use my web site. But when I run my application on Tomcat(9.0), I try access a page, and redirect to login page, and when i try to sign in, I get the error ERR_TOO_MANY_REDIRECTS Error Example: When my spring boot app is runing on Tomcat, and I try to access the html page: https://domain/chat/example.html if the user was not

Spring Boot OAuth2, with Tomcat and nginx get error ERR_TOO_MANY_REDIRECTS after authenticate

佐手、 提交于 2021-02-10 06:51:14
问题 I have a Spring Boot application, it use OAuth2 authentication from WSO2 Identity Server. When I run the aplication on Spring Tool Suit, it works, so i can sing in and use my web site. But when I run my application on Tomcat(9.0), I try access a page, and redirect to login page, and when i try to sign in, I get the error ERR_TOO_MANY_REDIRECTS Error Example: When my spring boot app is runing on Tomcat, and I try to access the html page: https://domain/chat/example.html if the user was not

Spring Boot OAuth2, with Tomcat and nginx get error ERR_TOO_MANY_REDIRECTS after authenticate

一个人想着一个人 提交于 2021-02-10 06:51:08
问题 I have a Spring Boot application, it use OAuth2 authentication from WSO2 Identity Server. When I run the aplication on Spring Tool Suit, it works, so i can sing in and use my web site. But when I run my application on Tomcat(9.0), I try access a page, and redirect to login page, and when i try to sign in, I get the error ERR_TOO_MANY_REDIRECTS Error Example: When my spring boot app is runing on Tomcat, and I try to access the html page: https://domain/chat/example.html if the user was not

how to achieve Ldap Authentication using spring security(spring boot)

夙愿已清 提交于 2021-02-10 04:15:31
问题 I have following code with me I am trying to achieve ldap Authentication but i think it is not happening. My Security Configuration @EnableWebSecurity @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) public class Config extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.httpBasic().and().authorizeRequests().antMatchers("/*") .permitAll().anyRequest().authenticated().and().csrf() .disable().httpBasic().and().csrf(

how to achieve Ldap Authentication using spring security(spring boot)

风流意气都作罢 提交于 2021-02-10 04:15:27
问题 I have following code with me I am trying to achieve ldap Authentication but i think it is not happening. My Security Configuration @EnableWebSecurity @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) public class Config extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.httpBasic().and().authorizeRequests().antMatchers("/*") .permitAll().anyRequest().authenticated().and().csrf() .disable().httpBasic().and().csrf(

how to achieve Ldap Authentication using spring security(spring boot)

≯℡__Kan透↙ 提交于 2021-02-10 04:14:57
问题 I have following code with me I am trying to achieve ldap Authentication but i think it is not happening. My Security Configuration @EnableWebSecurity @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) public class Config extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.httpBasic().and().authorizeRequests().antMatchers("/*") .permitAll().anyRequest().authenticated().and().csrf() .disable().httpBasic().and().csrf(

how to achieve Ldap Authentication using spring security(spring boot)

本小妞迷上赌 提交于 2021-02-10 04:14:09
问题 I have following code with me I am trying to achieve ldap Authentication but i think it is not happening. My Security Configuration @EnableWebSecurity @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) public class Config extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.httpBasic().and().authorizeRequests().antMatchers("/*") .permitAll().anyRequest().authenticated().and().csrf() .disable().httpBasic().and().csrf(