diff --git a/src/main/kotlin/com/test/test/rest/TestController.kt b/src/main/kotlin/com/test/test/rest/TestController.kt index 17ea779..ddd9f8a 100644 --- a/src/main/kotlin/com/test/test/rest/TestController.kt +++ b/src/main/kotlin/com/test/test/rest/TestController.kt @@ -16,6 +16,16 @@ class TestController { return "Test page" } + @GetMapping("/debug") + fun debug(): Map { + val auth = SecurityContextHolder.getContext().authentication + return mapOf( + "isAuthenticated" to auth.isAuthenticated, + "name" to auth.name, + "authorities" to auth.authorities.map { it.authority } + ) + } + @PreAuthorize("hasRole('USER')") @GetMapping("/users") fun users(): ArrayList {