Class OrganizationAwareIdentityProviderBean

java.lang.Object
org.keycloak.forms.login.freemarker.model.IdentityProviderBean
org.keycloak.organization.forms.login.freemarker.model.OrganizationAwareIdentityProviderBean

public class OrganizationAwareIdentityProviderBean extends IdentityProviderBean
  • Constructor Details

    • OrganizationAwareIdentityProviderBean

      public OrganizationAwareIdentityProviderBean(IdentityProviderBean delegate)
    • OrganizationAwareIdentityProviderBean

      public OrganizationAwareIdentityProviderBean(IdentityProviderBean delegate, boolean onlyOrganizationBrokers)
    • OrganizationAwareIdentityProviderBean

      public OrganizationAwareIdentityProviderBean(IdentityProviderBean delegate, boolean onlyOrganizationBrokers, boolean onlyRealmBrokers)
  • Method Details

    • getLinkedBrokerAliases

      protected Set<String> getLinkedBrokerAliases(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.authentication.AuthenticationFlowContext context)
      Description copied from class: IdentityProviderBean
      Returns the list of IDPs linked with the user's federated identities, if any. In case these IDPs exist, the login page should show only the IDPs already linked to the user. Returning null indicates that all public enabled IDPs should be available.

      Returning an empty set essentially narrows the list of available IDPs to zero, so no IDPs will be shown for login.
      Overrides:
      getLinkedBrokerAliases in class IdentityProviderBean
      Parameters:
      session - a reference to the KeycloakSession.
      realm - a reference to the realm.
      context - a reference to the AuthenticationFlowContext.
      Returns:
      a Set containing the aliases of the IDPs that should be available for login. An empty set indicates that no IDPs should be available.
    • searchForIdentityProviders

      protected List<IdentityProviderBean.IdentityProvider> searchForIdentityProviders(String existingIDP)
      Description copied from class: IdentityProviderBean
      Builds and returns a list of IdentityProviderBean.IdentityProvider instances that will be available for login. This method goes to the IdentityProviderStorageProvider to fetch the IDPs that can be used for login (enabled, not link-only and not set to be hidden on login page).
      Overrides:
      searchForIdentityProviders in class IdentityProviderBean
      Parameters:
      existingIDP - the alias of the IDP that must be filtered out from the result (used when linking a new IDP to a user's account).
      Returns:
      a List containing the constructed IdentityProviderBean.IdentityProviders.
    • federatedProviderPredicate

      protected Predicate<org.keycloak.models.IdentityProviderModel> federatedProviderPredicate()
      Description copied from class: IdentityProviderBean
      Returns a predicate that can filter out IDPs associated with the current user's federated identities before those are converted into IdentityProviderBean.IdentityProviders. Subclasses may use this as a way to further refine the IDPs that are to be returned.
      Overrides:
      federatedProviderPredicate in class IdentityProviderBean
      Returns:
      the custom Predicate used as a last filter before conversion into IdentityProviderBean.IdentityProvider