Skip to content

Commit

Permalink
SHIBUI-2030
Browse files Browse the repository at this point in the history
fix login issue
  • Loading branch information
chasegawa committed Aug 20, 2021
1 parent d596598 commit 5a032d3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import edu.internet2.tier.shibboleth.admin.ui.security.springsecurity.AdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -38,6 +37,9 @@
@ConditionalOnMissingBean(WebSecurityConfigurerAdapter.class)
public class WebSecurityConfig {

@Value("${shibui.roles.authenticated}")
private String[] acceptedAuthenticationRoles;

@Value("${shibui.logout-url:/dashboard}")
private String logoutUrl;

Expand Down Expand Up @@ -76,7 +78,7 @@ protected void configure(HttpSecurity http) throws Exception {
.and()
.authorizeRequests()
.antMatchers("/unsecured/**/*").permitAll()
.anyRequest().hasAnyRole("USER", "ADMIN")
.anyRequest().hasAnyRole(acceptedAuthenticationRoles)
.and()
.exceptionHandling().accessDeniedHandler((request, response, accessDeniedException) -> response.sendRedirect("/unsecured/error.html"))
.and()
Expand Down Expand Up @@ -157,5 +159,4 @@ public void configure(WebSecurity web) throws Exception {
}
};
}
}

}

0 comments on commit 5a032d3

Please sign in to comment.