keycloak
公開メンバ関数 | 限定公開変数類 | 非公開変数類 | 全メンバ一覧
org.keycloak.authorization.admin.PolicyEvaluationService.CloseableKeycloakIdentity クラス
org.keycloak.authorization.admin.PolicyEvaluationService.CloseableKeycloakIdentity の継承関係図
Inheritance graph
org.keycloak.authorization.admin.PolicyEvaluationService.CloseableKeycloakIdentity 連携図
Collaboration graph

公開メンバ関数

 CloseableKeycloakIdentity (AccessToken accessToken, KeycloakSession keycloakSession, UserSessionModel userSession)
 
void close ()
 
String getId ()
 
Attributes getAttributes ()
 
AccessToken getAccessToken ()
 
boolean isResourceServer ()
 
default boolean hasRealmRole (String roleName)
 
default boolean hasClientRole (String clientId, String roleName)
 

限定公開変数類

final AccessToken accessToken
 
final RealmModel realm
 
final KeycloakSession keycloakSession
 
final Attributes attributes
 

非公開変数類

UserSessionModel userSession
 

詳解

構築子と解体子

◆ CloseableKeycloakIdentity()

org.keycloak.authorization.admin.PolicyEvaluationService.CloseableKeycloakIdentity.CloseableKeycloakIdentity ( AccessToken  accessToken,
KeycloakSession  keycloakSession,
UserSessionModel  userSession 
)
inline
202  {
204  this.userSession = userSession;
205  }
final AccessToken accessToken
Definition: KeycloakIdentity.java:59
final KeycloakSession keycloakSession
Definition: KeycloakIdentity.java:61
UserSessionModel userSession
Definition: PolicyEvaluationService.java:200

関数詳解

◆ close()

void org.keycloak.authorization.admin.PolicyEvaluationService.CloseableKeycloakIdentity.close ( )
inline
207  {
208  if (userSession != null) {
210  }
211 
212  }
final RealmModel realm
Definition: KeycloakIdentity.java:60
final KeycloakSession keycloakSession
Definition: KeycloakIdentity.java:61
void removeUserSession(RealmModel realm, UserSessionModel session)
UserSessionModel userSession
Definition: PolicyEvaluationService.java:200
UserSessionProvider sessions()

◆ getAccessToken()

AccessToken org.keycloak.authorization.common.KeycloakIdentity.getAccessToken ( )
inlineinherited
228  {
229  return this.accessToken;
230  }
final AccessToken accessToken
Definition: KeycloakIdentity.java:59

◆ getAttributes()

Attributes org.keycloak.authorization.common.KeycloakIdentity.getAttributes ( )
inlineinherited

org.keycloak.authorization.identity.Identityを実装しています。

224  {
225  return this.attributes;
226  }
final Attributes attributes
Definition: KeycloakIdentity.java:62

◆ getId()

String org.keycloak.authorization.common.KeycloakIdentity.getId ( )
inlineinherited

org.keycloak.authorization.identity.Identityを実装しています。

214  {
215  if (isResourceServer()) {
216  ClientModel client = getTargetClient();
217  return client==null ? null : client.getId();
218  }
219 
220  return this.getUserFromSessionState().getId();
221  }
ClientModel getTargetClient()
Definition: KeycloakIdentity.java:248
boolean isResourceServer()
Definition: KeycloakIdentity.java:232
UserModel getUserFromSessionState()
Definition: KeycloakIdentity.java:261

◆ hasClientRole()

default boolean org.keycloak.authorization.identity.Identity.hasClientRole ( String  clientId,
String  roleName 
)
inlineinherited

Indicates if this identity is granted with a client role with the given roleName.

引数
clientIdthe client id
roleNamethe name of the role
戻り値
true if the identity has the given role. Otherwise, it returns false.

org.keycloak.authorization.common.ClientModelIdentity, org.keycloak.authorization.common.UserModelIdentityで実装されています。

66  {
67  return getAttributes().containsValue("kc.client." + clientId + ".roles", roleName);
68  }
default boolean containsValue(String name, String value)
Definition: Attributes.java:67

◆ hasRealmRole()

default boolean org.keycloak.authorization.identity.Identity.hasRealmRole ( String  roleName)
inlineinherited

Indicates if this identity is granted with a realm role with the given roleName.

引数
roleNamethe name of the role
戻り値
true if the identity has the given role. Otherwise, it returns false.

org.keycloak.authorization.common.ClientModelIdentity, org.keycloak.authorization.common.UserModelIdentityで実装されています。

54  {
55  return getAttributes().containsValue("kc.realm.roles", roleName);
56  }
default boolean containsValue(String name, String value)
Definition: Attributes.java:67

◆ isResourceServer()

boolean org.keycloak.authorization.common.KeycloakIdentity.isResourceServer ( )
inlineinherited
232  {
233  UserModel clientUser = null;
234 
235  ClientModel clientModel = getTargetClient();
236 
237  if (clientModel != null) {
238  clientUser = this.keycloakSession.users().getServiceAccount(clientModel);
239  }
240 
241  if (clientUser == null) {
242  return false;
243  }
244 
245  return this.getUserFromSessionState().getId().equals(clientUser.getId());
246  }
ClientModel getTargetClient()
Definition: KeycloakIdentity.java:248
final KeycloakSession keycloakSession
Definition: KeycloakIdentity.java:61
UserModel getUserFromSessionState()
Definition: KeycloakIdentity.java:261
UserModel getServiceAccount(ClientModel client)

メンバ詳解

◆ accessToken

final AccessToken org.keycloak.authorization.common.KeycloakIdentity.accessToken
protectedinherited

◆ attributes

final Attributes org.keycloak.authorization.common.KeycloakIdentity.attributes
protectedinherited

◆ keycloakSession

final KeycloakSession org.keycloak.authorization.common.KeycloakIdentity.keycloakSession
protectedinherited

◆ realm

final RealmModel org.keycloak.authorization.common.KeycloakIdentity.realm
protectedinherited

◆ userSession

UserSessionModel org.keycloak.authorization.admin.PolicyEvaluationService.CloseableKeycloakIdentity.userSession
private

このクラス詳解は次のファイルから抽出されました: