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 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)`
    `AccessCode` | `createAccessCode(String scopeParam, String state, String redirect, KeycloakSession session, RealmModel realm, ClientModel client, UserModel user, UserSessionModel userSession)`
    `AccessToken` | `createClientAccessToken(Set<RoleModel> requestedRoles, RealmModel realm, ClientModel client, UserModel user, UserSessionModel session)`
    `String` | `encodeToken(RealmModel realm, Object token)`
    `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, Audit audit)`
    `TokenManager.AccessTokenResponseBuilder` | `responseBuilder(RealmModel realm, ClientModel client, Audit audit)`
    `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)

    - #### createAccessCode

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

    - #### refreshAccessToken

          public AccessToken refreshAccessToken(KeycloakSession session,
                                       javax.ws.rs.core.UriInfo uriInfo,
                                       ClientConnection connection,
                                       RealmModel realm,
                                       ClientModel client,
                                       String encodedRefreshToken,
                                       Audit audit)
                                         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)

    - #### getAccess

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

Copyright © 2014. All Rights Reserved.