Skip to content

Commit 1078de7

Browse files
committed
add back frameworkendpoint
1 parent edfefa5 commit 1078de7

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

spring-security-oauth-server/src/main/java/org/baeldung/config/RevokeTokenEndpoint.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
import org.springframework.web.bind.annotation.RequestMapping;
88
import org.springframework.web.bind.annotation.RequestMethod;
99
import org.springframework.web.bind.annotation.ResponseBody;
10+
import org.springframework.security.oauth2.provider.endpoint.FrameworkEndpoint;
1011

11-
// @FrameworkEndpoint
12+
@FrameworkEndpoint
1213
public class RevokeTokenEndpoint {
1314

1415
@Resource(name = "tokenServices")

spring-security-oauth-server/src/main/java/org/baeldung/config/TokenController.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ public class TokenController {
2626
@Resource(name = "tokenStore")
2727
TokenStore tokenStore;
2828

29-
@RequestMapping(method = RequestMethod.DELETE, value = "/oauth/token")
30-
@ResponseBody
31-
public void revokeToken(HttpServletRequest request) {
32-
String authorization = request.getHeader("Authorization");
33-
if (authorization != null && authorization.contains("Bearer")) {
34-
String tokenId = authorization.substring("Bearer".length() + 1);
35-
tokenServices.revokeToken(tokenId);
36-
}
37-
}
38-
3929
@RequestMapping(method = RequestMethod.POST, value = "/oauth/token/revokeById/{tokenId}")
4030
@ResponseBody
4131
public void revokeToken(HttpServletRequest request, @PathVariable String tokenId) {

0 commit comments

Comments
 (0)