keycloak-service
クラス | 公開メンバ関数 | 非公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean クラス
org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean 連携図
Collaboration graph

クラス

class  FederatedIdentityEntry
 

公開メンバ関数

 AccountFederatedIdentityBean (KeycloakSession session, RealmModel realm, UserModel user, URI baseUri, String stateChecker)
 
List< FederatedIdentityEntrygetIdentities ()
 
boolean isRemoveLinkPossible ()
 

非公開メンバ関数

FederatedIdentityModel getIdentity (Set< FederatedIdentityModel > identities, String providerId)
 

非公開変数類

final List< FederatedIdentityEntryidentities = new ArrayList<>()
 
final boolean removeLinkPossible
 
final KeycloakSession session
 

静的非公開変数類

static OrderedModel.OrderedModelComparator< FederatedIdentityEntryIDP_COMPARATOR_INSTANCE = new OrderedModel.OrderedModelComparator<>()
 

詳解

著者
Marek Posolda
Vlastimil Elias

構築子と解体子

◆ AccountFederatedIdentityBean()

org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.AccountFederatedIdentityBean ( KeycloakSession  session,
RealmModel  realm,
UserModel  user,
URI  baseUri,
String  stateChecker 
)
inline
46  {
47  this.session = session;
48 
49  List<IdentityProviderModel> identityProviders = realm.getIdentityProviders();
50  Set<FederatedIdentityModel> identities = session.users().getFederatedIdentities(user, realm);
51 
52  int availableIdentities = 0;
53  if (identityProviders != null && !identityProviders.isEmpty()) {
54  for (IdentityProviderModel provider : identityProviders) {
55  if (!provider.isEnabled()) {
56  continue;
57  }
58  String providerId = provider.getAlias();
59 
60  FederatedIdentityModel identity = getIdentity(identities, providerId);
61 
62  if (identity != null) {
63  availableIdentities++;
64  }
65 
66  String displayName = KeycloakModelUtils.getIdentityProviderDisplayName(session, provider);
67  FederatedIdentityEntry entry = new FederatedIdentityEntry(identity, displayName, provider.getAlias(), provider.getAlias(),
68  provider.getConfig() != null ? provider.getConfig().get("guiOrder") : null);
69  this.identities.add(entry);
70  }
71  }
72 
73  this.identities.sort(IDP_COMPARATOR_INSTANCE);
74 
75  // Removing last social provider is not possible if you don't have other possibility to authenticate
76  this.removeLinkPossible = availableIdentities > 1 || user.getFederationLink() != null || AccountFormService.isPasswordSet(session, realm, user);
77  }
final KeycloakSession session
Definition: AccountFederatedIdentityBean.java:44
final boolean removeLinkPossible
Definition: AccountFederatedIdentityBean.java:43
final List< FederatedIdentityEntry > identities
Definition: AccountFederatedIdentityBean.java:42
FederatedIdentityModel getIdentity(Set< FederatedIdentityModel > identities, String providerId)
Definition: AccountFederatedIdentityBean.java:79
static OrderedModel.OrderedModelComparator< FederatedIdentityEntry > IDP_COMPARATOR_INSTANCE
Definition: AccountFederatedIdentityBean.java:40

関数詳解

◆ getIdentities()

List<FederatedIdentityEntry> org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.getIdentities ( )
inline
88  {
89  return identities;
90  }
final List< FederatedIdentityEntry > identities
Definition: AccountFederatedIdentityBean.java:42

◆ getIdentity()

FederatedIdentityModel org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.getIdentity ( Set< FederatedIdentityModel >  identities,
String  providerId 
)
inlineprivate
79  {
80  for (FederatedIdentityModel link : identities) {
81  if (providerId.equals(link.getIdentityProvider())) {
82  return link;
83  }
84  }
85  return null;
86  }
final List< FederatedIdentityEntry > identities
Definition: AccountFederatedIdentityBean.java:42

◆ isRemoveLinkPossible()

boolean org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.isRemoveLinkPossible ( )
inline
92  {
93  return removeLinkPossible;
94  }
final boolean removeLinkPossible
Definition: AccountFederatedIdentityBean.java:43

メンバ詳解

◆ identities

final List<FederatedIdentityEntry> org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.identities = new ArrayList<>()
private

◆ IDP_COMPARATOR_INSTANCE

OrderedModel.OrderedModelComparator<FederatedIdentityEntry> org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.IDP_COMPARATOR_INSTANCE = new OrderedModel.OrderedModelComparator<>()
staticprivate

◆ removeLinkPossible

final boolean org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.removeLinkPossible
private

◆ session

final KeycloakSession org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean.session
private

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