org.keycloak.authorization.common

## Class KeycloakIdentity

- java.lang.Object
- - org.keycloak.authorization.common.KeycloakIdentity

- All Implemented Interfaces:
    Identity

      public class KeycloakIdentity
      extends Object
      implements Identity

  Author:
    Pedro Igor

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AccessToken` | `accessToken`
    `protected Attributes` | `attributes`
    `protected KeycloakSession` | `keycloakSession`
    `protected RealmModel` | `realm`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeycloakIdentity(AccessToken accessToken, KeycloakSession keycloakSession)`
    `KeycloakIdentity(IDToken token, KeycloakSession keycloakSession, RealmModel realm)`
    `KeycloakIdentity(KeycloakSession keycloakSession)`
    `KeycloakIdentity(KeycloakSession keycloakSession, IDToken token)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AccessToken` | `getAccessToken()`
    `Attributes` | `getAttributes()` Returns the attributes or claims associated with this identity.
    `String` | `getId()` Returns the unique identifier of this identity.
    `boolean` | `isResourceServer()`

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

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

    - ### Methods inherited from interface org.keycloak.authorization.identity.Identity

      `hasClientRole, hasRealmRole`

- - ### Field Detail

    - #### accessToken

          protected final AccessToken accessToken

    - #### realm

          protected final RealmModel realm

    - #### keycloakSession

          protected final KeycloakSession keycloakSession

    - #### attributes

          protected final Attributes attributes

  - ### Constructor Detail

    - #### KeycloakIdentity

          public KeycloakIdentity(KeycloakSession keycloakSession)

    - #### KeycloakIdentity

          public KeycloakIdentity(KeycloakSession keycloakSession,
                                  IDToken token)

    - #### KeycloakIdentity

          public KeycloakIdentity(IDToken token,
                                  KeycloakSession keycloakSession,
                                  RealmModel realm)

    - #### KeycloakIdentity

          public KeycloakIdentity(AccessToken accessToken,
                                  KeycloakSession keycloakSession)

  - ### Method Detail

    - #### getId

          public String getId()

      Description copied from interface: `Identity`
      Returns the unique identifier of this identity.
      Specified by:
        `getId` in interface `Identity`
      Returns:
        the unique identifier of this identity

    - #### getAttributes

          public Attributes getAttributes()

      Description copied from interface: `Identity`
      Returns the attributes or claims associated with this identity.
      Specified by:
        `getAttributes` in interface `Identity`
      Returns:
        the attributes or claims associated with this identity

    - #### getAccessToken

          public AccessToken getAccessToken()

    - #### isResourceServer

          public boolean isResourceServer()

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