org.keycloak.protocol.oidc

## Class TokenManager

- java.lang.Object
- - org.keycloak.protocol.oidc.TokenManager

-     public class TokenManager
      extends Object

  Stateful object that creates tokens and manages oauth access codes
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `TokenManager.AccessTokenResponseBuilder`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.jboss.logging.Logger` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addComposites(AccessToken token, RoleModel role)`
    `static void` | `applyScope(RoleModel role, RoleModel scope, Set<RoleModel> visited, Set<RoleModel> requested)`
    `static void` | `attachClientSession(UserSessionModel session, ClientSessionModel clientSession)`
    `AccessToken` | `createClientAccessToken(Set<RoleModel> requestedRoles, RealmModel realm, ClientModel client, UserModel user, UserSessionModel session)`
    `String` | `encodeToken(RealmModel realm, Object token)`
    `static Set<RoleModel>` | `getAccess(String scopeParam, ClientModel client, UserModel user)`
    `void` | `initClaims(IDToken token, ClientModel model, UserModel user)`
    `protected IDToken` | `initIDToken(RealmModel realm, ClientModel claimer, UserModel client, UserModel user)`
    `protected AccessToken` | `initToken(RealmModel realm, ClientModel client, UserModel user, UserSessionModel session)`
    `AccessToken` | `refreshAccessToken(KeycloakSession session, javax.ws.rs.core.UriInfo uriInfo, ClientConnection connection, RealmModel realm, ClientModel client, String encodedRefreshToken, EventBuilder event)`
    `TokenManager.AccessTokenResponseBuilder` | `responseBuilder(RealmModel realm, ClientModel client, EventBuilder event)`
    `void` | `verifyAccess(AccessToken token, RealmModel realm, ClientModel client, UserModel user)`
    `RefreshToken` | `verifyRefreshToken(RealmModel realm, String encodedRefreshToken)`

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

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

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

  - ### Constructor Detail

    - #### TokenManager

          public TokenManager()

  - ### Method Detail

    - #### applyScope

          public static void applyScope(RoleModel role,
                        RoleModel scope,
                        Set<RoleModel> visited,
                        Set<RoleModel> requested)

    - #### refreshAccessToken

          public AccessToken refreshAccessToken(KeycloakSession session,
                                       javax.ws.rs.core.UriInfo uriInfo,
                                       ClientConnection connection,
                                       RealmModel realm,
                                       ClientModel client,
                                       String encodedRefreshToken,
                                       EventBuilder event)
                                         throws OAuthErrorException

      Throws:
        `OAuthErrorException`

    - #### verifyRefreshToken

          public RefreshToken verifyRefreshToken(RealmModel realm,
                                        String encodedRefreshToken)
                                          throws OAuthErrorException

      Throws:
        `OAuthErrorException`

    - #### createClientAccessToken

          public AccessToken createClientAccessToken(Set<RoleModel> requestedRoles,
                                            RealmModel realm,
                                            ClientModel client,
                                            UserModel user,
                                            UserSessionModel session)

    - #### attachClientSession

          public static void attachClientSession(UserSessionModel session,
                                 ClientSessionModel clientSession)

    - #### getAccess

          public static Set<RoleModel> getAccess(String scopeParam,
                                 ClientModel client,
                                 UserModel user)

    - #### verifyAccess

          public void verifyAccess(AccessToken token,
                          RealmModel realm,
                          ClientModel client,
                          UserModel user)
                            throws OAuthErrorException

      Throws:
        `OAuthErrorException`

    - #### initClaims

          public void initClaims(IDToken token,
                        ClientModel model,
                        UserModel user)

    - #### initIDToken

          protected IDToken initIDToken(RealmModel realm,
                            ClientModel claimer,
                            UserModel client,
                            UserModel user)

    - #### initToken

          protected AccessToken initToken(RealmModel realm,
                              ClientModel client,
                              UserModel user,
                              UserSessionModel session)

    - #### addComposites

          protected void addComposites(AccessToken token,
                           RoleModel role)

    - #### encodeToken

          public String encodeToken(RealmModel realm,
                           Object token)

    - #### responseBuilder

          public TokenManager.AccessTokenResponseBuilder responseBuilder(RealmModel realm,
                                                                ClientModel client,
                                                                EventBuilder event)

Copyright © 2014. All Rights Reserved.