org.keycloak.services.managers

## Class Auth

- java.lang.Object
- - org.keycloak.services.managers.Auth

-     public class Auth
      extends Object

  Author:
    Stian Thorgersen

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Auth(RealmModel realm, AccessToken token, UserModel user, ClientModel client, UserSessionModel session, boolean cookie)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientModel` | `getClient()`
    `AuthenticatedClientSessionModel` | `getClientSession()`
    `RealmModel` | `getRealm()`
    `UserSessionModel` | `getSession()`
    `AccessToken` | `getToken()`
    `UserModel` | `getUser()`
    `boolean` | `hasClientRole(ClientModel app, String role)`
    `boolean` | `hasOneOfAppRole(ClientModel app, String... roles)`
    `boolean` | `hasOneOfRealmRole(String... roles)`
    `boolean` | `hasRealmRole(String role)`
    `boolean` | `isCookieAuthenticated()`
    `void` | `require(String role)`
    `void` | `requireOneOf(String... roles)`
    `void` | `setClientSession(AuthenticatedClientSessionModel clientSession)`

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

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

- - ### Constructor Detail

    - #### Auth

          public Auth(RealmModel realm,
                      AccessToken token,
                      UserModel user,
                      ClientModel client,
                      UserSessionModel session,
                      boolean cookie)

  - ### Method Detail

    - #### isCookieAuthenticated

          public boolean isCookieAuthenticated()

    - #### getRealm

          public RealmModel getRealm()

    - #### getUser

          public UserModel getUser()

    - #### getClient

          public ClientModel getClient()

    - #### getToken

          public AccessToken getToken()

    - #### getSession

          public UserSessionModel getSession()

    - #### getClientSession

          public AuthenticatedClientSessionModel getClientSession()

    - #### setClientSession

          public void setClientSession(AuthenticatedClientSessionModel clientSession)

    - #### require

          public void require(String role)

    - #### requireOneOf

          public void requireOneOf(String... roles)

    - #### hasRealmRole

          public boolean hasRealmRole(String role)

    - #### hasOneOfRealmRole

          public boolean hasOneOfRealmRole(String... roles)

    - #### hasClientRole

          public boolean hasClientRole(ClientModel app,
                                       String role)

    - #### hasOneOfAppRole

          public boolean hasOneOfAppRole(ClientModel app,
                                         String... roles)

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