Class ClaimsProvider

java.lang.Object
swiss.trustbroker.federation.xmlconfig.ClaimsProvider
All Implemented Interfaces:
Serializable, swiss.trustbroker.api.homerealmdiscovery.attributes.HrdClaimsProviderToRelyingPartyMapping

public class ClaimsProvider extends Object implements Serializable, swiss.trustbroker.api.homerealmdiscovery.attributes.HrdClaimsProviderToRelyingPartyMapping
Configuration for CP mapped to an RP.
See Also:
  • Constructor Details

    • ClaimsProvider

      public ClaimsProvider()
    • ClaimsProvider

      public ClaimsProvider(String id, Boolean enabled, String clientNetworks, String relyingPartyAlias, String hrdHintAlias, String banner, Integer order, String name, String title, String description, String img, String button, String shortcut, String color, Boolean noticeEnabled, Integer noticeMaxAgeSec, List<String> noticeClaimsProviders)
      Deprecated.
      remove
      Creates a new ClaimsProvider instance.
      Parameters:
      id - References the issuer ID of the CP.
      enabled - Allow pre-configuration of ClaimsProviderMappings with enabled or disabled ClaimsParty in profiles and only pick them per relying party in setup. Default: Unset value signals an enabled claims party and ignoring entries with the same id in the profile.
      clientNetworks - A comma separated list of network identifiers. When computing the HRD screen the incoming loadbalancer HTTP Header Client_Network (is considered to filter out CPs that are not defined on the incoming network, mainly:
      • INTRANET (intranet)
      • INTERNET (external networks)
      relyingPartyAlias - By providing a relying party ID on the HRD declaration, it's not necessary anymore to copy and paste entire RP definition files just to be able to automatically selecting an RP without showing a HRD selection screen. The relyingPartyAlias can refer to these three inputs:
      • SAML AuthnRequest.Issuer ID
      • SAML AuthnRequest.ProviderName
      • OIDC client_id
      The HRD entries with a relyingPartyAlias attribute are not shown on the HRD screen but are used to directly dispatch towards the CP when an RP with this issuer ID comes along.
      If no alias matches through and no HRD entries without an alias remain, all the tiles are displayed through.
      hrdHintAlias - The HRD hint parameter sent by the RP is matched against the following attributes of the ClaimsProvider element.
      This allows decoupling the RP configuration from the internal CP ID. If configured, only the alias is checked against the HRD hint to avoid accidental dependency on the CP ID.
      The HRD hint is matched against the following ClaimsProvider fields in the given order:
      1. hrdHintAlias
      2. name
      3. id
      Name and/or ID might be URNs, in which case the hrdHintAlias can also help avoiding URL parameter encoding issues.
      banner - Show this banner above the HRD selection area if tile is enabled.
      order - Indicates the order of display in the UI. Special values:
      1. less or equal 0 - do not show in UI
      2. 1xx - first priority CPs (displayed larger, ordered numerically)
      3. 2xx - second priority CPs (displayed larger, ordered numerically)
      4. 3xx - third priority CPs (displayed smalled, ordered numerically)
      Default: ordered of definition in the XML
      name - Name displayed to the user directly. The XTB SPA frontend uses it to translate the name into a text with the translation service. The skinny frontend uses the items directly.
      title - Title for the CP tile and help item.
      The fallback order (if not defined) is: title > name > ID
      description - Text displayed in the CP tile.
      The fallback order (if not defined) is: description > name > ID
      img - Image displayed in the HRD large view.
      button - Image displayed in the small view. This feature was removed and replaced by shortcut/color rendering. The small view was dropped in v1.5.
      shortcut - A usually two-character code identifying the CP on small screens.
      color - HTML color code identifying the CP on small screens.
      noticeEnabled - Notice enabled
      noticeMaxAgeSec - Notice max age
      noticeClaimsProviders - The list of ClaimsProviders name
      Since:
      1.9.0, 1.10.0, 1.9.0, 1.9.0, 1.14.0, 1.14.0, 1.14.0
      See Also:
  • Method Details

    • isValidForNetwork

      public final boolean isValidForNetwork(String network)
    • isMatchingRelyingPartyAlias

      public final boolean isMatchingRelyingPartyAlias(String rpIssuer)
    • of

      public static ClaimsProvider of(swiss.trustbroker.api.homerealmdiscovery.attributes.HrdClaimsProviderToRelyingPartyMapping mapping)
    • isDisplayed

      public boolean isDisplayed()
    • isEnabledAndValid

      public boolean isEnabledAndValid()
    • isMatchingHrdHint

      public boolean isMatchingHrdHint(String cpSelectionHint)
    • builder

      public static ClaimsProvider.ClaimsProviderBuilder builder()
    • getId

      public String getId()
      References the issuer ID of the CP.
      Specified by:
      getId in interface swiss.trustbroker.api.homerealmdiscovery.attributes.HrdClaimsProviderToRelyingPartyMapping
    • getEnabled

      public Boolean getEnabled()
      Allow pre-configuration of ClaimsProviderMappings with enabled or disabled ClaimsParty in profiles and only pick them per relying party in setup. Default: Unset value signals an enabled claims party and ignoring entries with the same id in the profile.
      Since:
      1.9.0
    • getClientNetworks

      public String getClientNetworks()
      A comma separated list of network identifiers. When computing the HRD screen the incoming loadbalancer HTTP Header Client_Network (is considered to filter out CPs that are not defined on the incoming network, mainly:
      • INTRANET (intranet)
      • INTERNET (external networks)
      Specified by:
      getClientNetworks in interface swiss.trustbroker.api.homerealmdiscovery.attributes.HrdClaimsProviderToRelyingPartyMapping
    • getRelyingPartyAlias

      public String getRelyingPartyAlias()
      By providing a relying party ID on the HRD declaration, it's not necessary anymore to copy and paste entire RP definition files just to be able to automatically selecting an RP without showing a HRD selection screen. The relyingPartyAlias can refer to these three inputs:
      • SAML AuthnRequest.Issuer ID
      • SAML AuthnRequest.ProviderName
      • OIDC client_id
      The HRD entries with a relyingPartyAlias attribute are not shown on the HRD screen but are used to directly dispatch towards the CP when an RP with this issuer ID comes along.
      If no alias matches through and no HRD entries without an alias remain, all the tiles are displayed through.
      Specified by:
      getRelyingPartyAlias in interface swiss.trustbroker.api.homerealmdiscovery.attributes.HrdClaimsProviderToRelyingPartyMapping
    • getHrdHintAlias

      public String getHrdHintAlias()
      The HRD hint parameter sent by the RP is matched against the following attributes of the ClaimsProvider element.
      This allows decoupling the RP configuration from the internal CP ID. If configured, only the alias is checked against the HRD hint to avoid accidental dependency on the CP ID.
      The HRD hint is matched against the following ClaimsProvider fields in the given order:
      1. hrdHintAlias
      2. name
      3. id
      Name and/or ID might be URNs, in which case the hrdHintAlias can also help avoiding URL parameter encoding issues.
      Since:
      1.10.0
      See Also:
    • getBanner

      public String getBanner()
      Show this banner above the HRD selection area if tile is enabled.
      Since:
      1.9.0
    • getOrder

      public Integer getOrder()
      Indicates the order of display in the UI. Special values:
      1. less or equal 0 - do not show in UI
      2. 1xx - first priority CPs (displayed larger, ordered numerically)
      3. 2xx - second priority CPs (displayed larger, ordered numerically)
      4. 3xx - third priority CPs (displayed smalled, ordered numerically)
      Default: ordered of definition in the XML
      Since:
      1.9.0
    • getName

      public String getName()
      Name displayed to the user directly. The XTB SPA frontend uses it to translate the name into a text with the translation service. The skinny frontend uses the items directly.
    • getTitle

      public String getTitle()
      Title for the CP tile and help item.
      The fallback order (if not defined) is: title > name > ID
    • getDescription

      public String getDescription()
      Text displayed in the CP tile.
      The fallback order (if not defined) is: description > name > ID
    • getImg

      public String getImg()
      Image displayed in the HRD large view.
    • getButton

      @Deprecated public String getButton()
      Deprecated.
      remove
      Image displayed in the small view. This feature was removed and replaced by shortcut/color rendering. The small view was dropped in v1.5.
    • getShortcut

      public String getShortcut()
      A usually two-character code identifying the CP on small screens.
    • getColor

      public String getColor()
      HTML color code identifying the CP on small screens.
    • getNoticeEnabled

      public Boolean getNoticeEnabled()
      Notice enabled
      Since:
      1.14.0
    • getNoticeMaxAgeSec

      public Integer getNoticeMaxAgeSec()
      Notice max age
      Since:
      1.14.0
    • getNoticeClaimsProviders

      public List<String> getNoticeClaimsProviders()
      The list of ClaimsProviders name
      Since:
      1.14.0
    • setId

      public void setId(String id)
      References the issuer ID of the CP.
    • setEnabled

      public void setEnabled(Boolean enabled)
      Allow pre-configuration of ClaimsProviderMappings with enabled or disabled ClaimsParty in profiles and only pick them per relying party in setup. Default: Unset value signals an enabled claims party and ignoring entries with the same id in the profile.
      Since:
      1.9.0
    • setClientNetworks

      public void setClientNetworks(String clientNetworks)
      A comma separated list of network identifiers. When computing the HRD screen the incoming loadbalancer HTTP Header Client_Network (is considered to filter out CPs that are not defined on the incoming network, mainly:
      • INTRANET (intranet)
      • INTERNET (external networks)
    • setRelyingPartyAlias

      public void setRelyingPartyAlias(String relyingPartyAlias)
      By providing a relying party ID on the HRD declaration, it's not necessary anymore to copy and paste entire RP definition files just to be able to automatically selecting an RP without showing a HRD selection screen. The relyingPartyAlias can refer to these three inputs:
      • SAML AuthnRequest.Issuer ID
      • SAML AuthnRequest.ProviderName
      • OIDC client_id
      The HRD entries with a relyingPartyAlias attribute are not shown on the HRD screen but are used to directly dispatch towards the CP when an RP with this issuer ID comes along.
      If no alias matches through and no HRD entries without an alias remain, all the tiles are displayed through.
    • setHrdHintAlias

      public void setHrdHintAlias(String hrdHintAlias)
      The HRD hint parameter sent by the RP is matched against the following attributes of the ClaimsProvider element.
      This allows decoupling the RP configuration from the internal CP ID. If configured, only the alias is checked against the HRD hint to avoid accidental dependency on the CP ID.
      The HRD hint is matched against the following ClaimsProvider fields in the given order:
      1. hrdHintAlias
      2. name
      3. id
      Name and/or ID might be URNs, in which case the hrdHintAlias can also help avoiding URL parameter encoding issues.
      Since:
      1.10.0
      See Also:
    • setBanner

      public void setBanner(String banner)
      Show this banner above the HRD selection area if tile is enabled.
      Since:
      1.9.0
    • setOrder

      public void setOrder(Integer order)
      Indicates the order of display in the UI. Special values:
      1. less or equal 0 - do not show in UI
      2. 1xx - first priority CPs (displayed larger, ordered numerically)
      3. 2xx - second priority CPs (displayed larger, ordered numerically)
      4. 3xx - third priority CPs (displayed smalled, ordered numerically)
      Default: ordered of definition in the XML
      Since:
      1.9.0
    • setName

      public void setName(String name)
      Name displayed to the user directly. The XTB SPA frontend uses it to translate the name into a text with the translation service. The skinny frontend uses the items directly.
    • setTitle

      public void setTitle(String title)
      Title for the CP tile and help item.
      The fallback order (if not defined) is: title > name > ID
    • setDescription

      public void setDescription(String description)
      Text displayed in the CP tile.
      The fallback order (if not defined) is: description > name > ID
    • setImg

      public void setImg(String img)
      Image displayed in the HRD large view.
    • setButton

      @Deprecated public void setButton(String button)
      Deprecated.
      remove
      Image displayed in the small view. This feature was removed and replaced by shortcut/color rendering. The small view was dropped in v1.5.
    • setShortcut

      public void setShortcut(String shortcut)
      A usually two-character code identifying the CP on small screens.
    • setColor

      public void setColor(String color)
      HTML color code identifying the CP on small screens.
    • setNoticeEnabled

      public void setNoticeEnabled(Boolean noticeEnabled)
      Notice enabled
      Since:
      1.14.0
    • setNoticeMaxAgeSec

      public void setNoticeMaxAgeSec(Integer noticeMaxAgeSec)
      Notice max age
      Since:
      1.14.0
    • setNoticeClaimsProviders

      public void setNoticeClaimsProviders(List<String> noticeClaimsProviders)
      The list of ClaimsProviders name
      Since:
      1.14.0
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object