PMT-9: Anlegen des Employee Services #5

Merged
SZUT-Dominik merged 8 commits from task/PMT-9-anlegen-des-employ-service into trunk 2024-09-30 12:37:00 +00:00
2 changed files with 16 additions and 1 deletions
Showing only changes of commit d3755984d9 - Show all commits

View file

@ -0,0 +1,13 @@
package de.hmmh.pmt;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class Config {
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}

View file

@ -2,6 +2,7 @@ package de.hmmh.pmt.auth;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
@ -25,7 +26,8 @@ public class JWT implements LogoutHandler {
private static final String OIDC_LOGOUT_ROUTE = "/protocol/openid-connect/logout"; private static final String OIDC_LOGOUT_ROUTE = "/protocol/openid-connect/logout";
private static final String OIDC_TOKEN_HINT_QUERY_PARAMETER = "id_token_hin"; private static final String OIDC_TOKEN_HINT_QUERY_PARAMETER = "id_token_hin";
private final RestTemplate template = new RestTemplate(); @Autowired
private RestTemplate template;
@Override @Override
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {