org.keycloak.jose.jws

## Class DefaultTokenManager

- java.lang.Object
- - org.keycloak.jose.jws.DefaultTokenManager

- All Implemented Interfaces:
    TokenManager

      public class DefaultTokenManager
      extends Object
      implements TokenManager

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTokenManager(KeycloakSession session)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `cekManagementAlgorithm(TokenCategory category)`
    `<T extends Token> T` | `decode(String token, Class<T> clazz)` Decodes and verifies the token, or `null` if the token was invalid
    `<T> T` | `decodeClientJWT(String token, ClientModel client, Class<T> clazz)`
    `String` | `encode(Token token)` Encodes the supplied token
    `String` | `encodeAndEncrypt(Token token)`
    `String` | `encryptAlgorithm(TokenCategory category)`
    `LogoutToken` | `initLogoutToken(ClientModel client, UserModel user, AuthenticatedClientSessionModel clientSession)`
    `String` | `signatureAlgorithm(TokenCategory category)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultTokenManager

          public DefaultTokenManager(KeycloakSession session)

  - ### Method Detail

    - #### encode

          public String encode(Token token)

      Description copied from interface: `TokenManager`
      Encodes the supplied token
      Specified by:
        `encode` in interface `TokenManager`
      Parameters:
        `token` - the token to encode
      Returns:
        The encoded token

    - #### decode

          public <T extends Token> T decode(String token,
                                            Class<T> clazz)

      Description copied from interface: `TokenManager`
      Decodes and verifies the token, or `null` if the token was invalid
      Specified by:
        `decode` in interface `TokenManager`
      Parameters:
        `token` - the token to decode
        `clazz` - the token type to return
      Returns:
        The decoded token, or `null` if the token was not valid

    - #### decodeClientJWT

          public <T> T decodeClientJWT(String token,
                                       ClientModel client,
                                       Class<T> clazz)

      Specified by:
        `decodeClientJWT` in interface `TokenManager`

    - #### signatureAlgorithm

          public String signatureAlgorithm(TokenCategory category)

      Specified by:
        `signatureAlgorithm` in interface `TokenManager`

    - #### encodeAndEncrypt

          public String encodeAndEncrypt(Token token)

      Specified by:
        `encodeAndEncrypt` in interface `TokenManager`

    - #### cekManagementAlgorithm

          public String cekManagementAlgorithm(TokenCategory category)

      Specified by:
        `cekManagementAlgorithm` in interface `TokenManager`

    - #### encryptAlgorithm

          public String encryptAlgorithm(TokenCategory category)

      Specified by:
        `encryptAlgorithm` in interface `TokenManager`

    - #### initLogoutToken

          public LogoutToken initLogoutToken(ClientModel client,
                                             UserModel user,
                                             AuthenticatedClientSessionModel clientSession)

      Specified by:
        `initLogoutToken` in interface `TokenManager`

Copyright © 2020 JBoss by Red Hat. All rights reserved.