Skip to content

Commit

Permalink
Merge branch 'main' into issue-19-OAuth_and_General_Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
devondragon authored Sep 11, 2023
2 parents 30e4daf + 45a1b89 commit 3023d3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Created by https://www.gitignore.io/api/java,gradle,eclipse
# Edit at https://www.gitignore.io/?templates=java,gradle,eclipse

### MacOS ###
*.DS_Store

### Eclipse ###
.metadata
bin/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public class WebSecurityConfig {
@Autowired
private DSOAuth2UserService dsOAuth2UserService;


/**
*
* The securityFilterChain method builds the security filter chain for Spring Security.
Expand Down Expand Up @@ -152,10 +151,12 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti

// Configure authorization rules based on the default action
if (DEFAULT_ACTION_DENY.equals(getDefaultAction())) {
// Allow access to unprotected URIs and require authentication for all other requests
// Allow access to unprotected URIs and require authentication for all other
// requests
http.authorizeHttpRequests().requestMatchers(unprotectedURIs.toArray(new String[0])).permitAll().anyRequest().authenticated();
} else if (DEFAULT_ACTION_ALLOW.equals(getDefaultAction())) {
// Require authentication for protected URIs and allow access to all other requests
// Require authentication for protected URIs and allow access to all other
// requests
http.authorizeHttpRequests().requestMatchers(protectedURIsArray).authenticated().requestMatchers("/**").permitAll();
} else {
// Log an error and deny access to all resources if the default action is not set correctly
Expand Down

0 comments on commit 3023d3b

Please sign in to comment.