File tree Expand file tree Collapse file tree 5 files changed +6
-17
lines changed
src/main/java/ch/ethz/seb/sps/server/weblayer Expand file tree Collapse file tree 5 files changed +6
-17
lines changed Original file line number Diff line number Diff line change 4343 <groupId >org.apache.maven.plugins</groupId >
4444 <artifactId >maven-compiler-plugin</artifactId >
4545 <configuration >
46- <source >17 </source >
47- <target >17 </target >
46+ <source >21 </source >
47+ <target >21 </target >
4848 <parameters >true</parameters >
4949 </configuration >
5050 </plugin >
Original file line number Diff line number Diff line change @@ -47,9 +47,6 @@ public class WebConfig implements WebMvcConfigurer {
4747 API .HEALTH_ENDPOINT + "/" ,
4848 API .GUI_REDIRECT_ENDPOINT ,
4949 API .OAUTH_JWTTOKEN_ENDPOINT + "/**" ,
50- "/swagger-ui/**" ,
51- "/v3/api-docs/**" ,
52- "/api-docs/**"
5350 };
5451
5552 /** Used to get real remote IP address by using "X-Forwarded-For" and "X-Forwarded-Proto" header.
Original file line number Diff line number Diff line change 3636public class OAuth2ClientCredentialsGrantProvider implements AuthenticationProvider {
3737
3838 private static final Logger logger = LoggerFactory .getLogger (OAuth2ClientCredentialsGrantProvider .class );
39- private static final String ERROR_URI = "https://datatracker.ietf.org/doc/html/rfc6749#section-5.2" ;
40-
41-
39+
4240 private final OAuth2AuthorizationService authorizationService ;
4341 private OAuth2TokenGenerator <? extends OAuth2Token > tokenGenerator ;
4442 private Consumer <OAuth2ClientCredentialsAuthenticationContext > authenticationValidator = new OAuth2ClientCredentialsAuthenticationValidator ();
@@ -68,7 +66,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
6866 } else {
6967 OAuth2ClientCredentialsAuthenticationContext authenticationContext = OAuth2ClientCredentialsAuthenticationContext .with (clientCredentialsAuthentication ).registeredClient (registeredClient ).build ();
7068 this .authenticationValidator .accept (authenticationContext );
71- Set <String > authorizedScopes = new LinkedHashSet (clientCredentialsAuthentication .getScopes ());
69+ Set <String > authorizedScopes = new LinkedHashSet <> (clientCredentialsAuthentication .getScopes ());
7270 authorizedScopes .add (API .SEB_API_SCOPE_NAME );
7371 if (logger .isTraceEnabled ()) {
7472 logger .trace ("Validated token request parameters" );
Original file line number Diff line number Diff line change @@ -36,11 +36,9 @@ public RegisteredGuiClient(
3636 @ Value ("${sps.api.admin.gui.clientId}" ) final String clientId ,
3737 @ Value ("${sps.api.admin.gui.clientSecret}" ) final String clientSecret ,
3838 @ Value ("${sps.api.admin.accessTokenValiditySeconds:3600}" ) final Integer accessTokenValiditySeconds ,
39- @ Value ("${sps.api.admin.refreshTokenValiditySeconds:-1 }" ) final Integer refreshTokenValiditySeconds ) {
39+ @ Value ("${sps.api.admin.refreshTokenValiditySeconds:86400 }" ) final Integer refreshTokenValiditySeconds ) {
4040
41- Duration refreshTokenValDuration = (refreshTokenValiditySeconds == null || refreshTokenValiditySeconds .longValue () < 0 )
42- ? Duration .of (1 , YEARS )
43- : Duration .of (refreshTokenValiditySeconds , SECONDS );
41+ final Duration refreshTokenValDuration = Duration .of (refreshTokenValiditySeconds , SECONDS );
4442
4543 client = RegisteredClient
4644 .withId (clientId )
Original file line number Diff line number Diff line change @@ -42,12 +42,8 @@ public class SEBClientResourceServerConfig {
4242
4343 @ Autowired
4444 private JwtDecoder jwtDecoder ;
45- @ Value ("${server.error.path}" )
46- private String errorPath ;
4745 @ Value ("${sps.api.session.endpoint}" )
4846 private String sessionAPIEndpoint ;
49- @ Value ("${sps.http.redirect}" )
50- private String unauthorizedRedirect ;
5147
5248 @ Bean
5349 @ Order (2 )
You can’t perform that action at this time.
0 commit comments