Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
Created April 28, 2021 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasdarimont/621d26c019145d132b6f91f9cbb520c3 to your computer and use it in GitHub Desktop.
Save thomasdarimont/621d26c019145d132b6f91f9cbb520c3 to your computer and use it in GitHub Desktop.
Keycloak-Snippet get current access token
    ```java
    KeycloakSession session = ResteasyProviderFactory.getContextData(KeycloakSession.class);
    AuthenticationManager.AuthResult authResult = new AppAuthManager.BearerTokenAuthenticator(session).authenticate();
    AccessToken token = authResult.getToken();
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment