org.keycloak.services.managers

## Class TokenManager

- java.lang.Object
- - org.keycloak.services.managers.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 Map<String,AccessCodeEntry>` | `accessCodeMap`
    `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)`
    `void` | `clearAccessCodes()`
    `AccessCodeEntry` | `createAccessCode(String scopeParam, String state, String redirect, RealmModel realm, ClientModel client, UserModel user, UserSessionModel session)`
    `AccessToken` | `createClientAccessToken(String scopeParam, RealmModel realm, ClientModel client, UserModel user, UserSessionModel session)`
    `AccessToken` | `createClientAccessToken(String scopeParam, RealmModel realm, ClientModel client, UserModel user, UserSessionModel session, List<RoleModel> realmRolesRequested, javax.ws.rs.core.MultivaluedMap<String,RoleModel> resourceRolesRequested)`
    `String` | `encodeToken(RealmModel realm, Object token)`
    `AccessCodeEntry` | `getAccessCode(String key)`
    `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)`
    `AccessCodeEntry` | `pullAccessCode(String key)`
    `AccessToken` | `refreshAccessToken(javax.ws.rs.core.UriInfo uriInfo, RealmModel realm, ClientModel client, String encodedRefreshToken, Audit audit)`
    `TokenManager.AccessTokenResponseBuilder` | `responseBuilder(RealmModel realm, ClientModel client, Audit audit)`

    - ### 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

    - #### accessCodeMap

          protected Map<String,AccessCodeEntry> accessCodeMap

  - ### Constructor Detail

    - #### TokenManager

          public TokenManager()

  - ### Method Detail

    - #### clearAccessCodes

          public void clearAccessCodes()

    - #### getAccessCode

          public AccessCodeEntry getAccessCode(String key)

    - #### pullAccessCode

          public AccessCodeEntry pullAccessCode(String key)

    - #### applyScope

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

    - #### createAccessCode

          public AccessCodeEntry createAccessCode(String scopeParam,
                                         String state,
                                         String redirect,
                                         RealmModel realm,
                                         ClientModel client,
                                         UserModel user,
                                         UserSessionModel session)

    - #### refreshAccessToken

          public AccessToken refreshAccessToken(javax.ws.rs.core.UriInfo uriInfo,
                                       RealmModel realm,
                                       ClientModel client,
                                       String encodedRefreshToken,
                                       Audit audit)
                                         throws OAuthErrorException

      Throws:
        `OAuthErrorException`

    - #### createClientAccessToken

          public AccessToken createClientAccessToken(String scopeParam,
                                            RealmModel realm,
                                            ClientModel client,
                                            UserModel user,
                                            UserSessionModel session)

    - #### createClientAccessToken

          public AccessToken createClientAccessToken(String scopeParam,
                                            RealmModel realm,
                                            ClientModel client,
                                            UserModel user,
                                            UserSessionModel session,
                                            List<RoleModel> realmRolesRequested,
                                            javax.ws.rs.core.MultivaluedMap<String,RoleModel> resourceRolesRequested)

    - #### 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,
                                                                Audit audit)

Copyright © 2014. All Rights Reserved.