PMT-9: Anlegen des Employee Services #5
2 changed files with 16 additions and 1 deletions
13
src/main/java/de/hmmh/pmt/Config.java
Normal file
13
src/main/java/de/hmmh/pmt/Config.java
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue