Created
October 2, 2019 15:29
-
-
Save akoserwal/ca957810d7198c97ea6c197393fb65e8 to your computer and use it in GitHub Desktop.
spring-jwt-token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String getJWTToken() { | |
| KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) SecurityContextHolder.getContext() | |
| .getAuthentication(); | |
| KeycloakPrincipal<KeycloakSecurityContext> keycloakPrincipal = (KeycloakPrincipal<KeycloakSecurityContext>) authentication | |
| .getPrincipal(); | |
| return keycloakPrincipal.getKeycloakSecurityContext().getTokenString(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment