The Shibboleth IdP V3 software has reached its End of Life and is no longer supported. This documentation is available for historical purposes only. See the IDP4 wiki space for current documentation on the supported version.

RpUIContext

The RelyingPartyUIContext renders information about the relying party drawn from its metadata.  This metadata generally allows language sensitive specification and the rpUIContext respects this.  Specifically it searches for the best match against the (ordered list of) supported languages specified by the browser and failing that for the best match against the (ordered list) of fallback languages specified in idp.properties as idp.ui.fallbackLanguages

In most cases the values are extracted from the Metadata of the relyingparty. The SAML Metadata and the SAML Metadata Login and Discover UI Extensions specifications provide the required details.

$rpUIContext.contactEmail(type)

This returns the (language specific) URL which is the email address of the contact of the specified type (if it exists in the metadata for the relying party).  The URL scheme is limited to http:, https: and mailto:. Other types will not render but will result in an error message in the log.

Parameter

Only one parameter can be provided, the type of the contact can be one of technical, support, administrative, billing, or other.

Example
#set ($email=$rpUIContext.contactEmail(support))
Contact the websites support team <a href="$encoder.encodeForHTMLAttribute($email)"/>here</a>

Specification

The email field is defined in the SAML Metadata  specification.

$rpUIContext.contactGivenName(type),  $rpUIContext.contactSurName(type), 

These return the (language specific) "Given Name" and "Surname" of the contact of the specified type (if it exists in the metadata for the relying party).

Parameter

Only one parameter can be provided, the type of the contact can be one of technical, support, administrative, billing, or other.

Example
#set ($surname=$rpUIContext.contactSurName(billing))
#set ($givenName=$rpUIContext.contactGiven(billing))
#if ($givenName) 
  #set ($name=$givenName $surname)
#else
  #set ($name=$surname)
#end
#if ($name)
	Billing Contact name is given as $encoder.encodeForHTML($name)
#else
    No Billing Contact name given.
#end

Specification

The given name are surname are defined in the SAML Metadata  specification.

$rpUIContext.informationURL

This returns the (language specific) Information URL if it exists in the metadata extensions for the relying party.  The URL scheme is limited to http: and https:.  Other types will not render but will result in an error message in the log.

Example
#set ($infoURL=$rpUIContext.informationURL)
#if ($infoURL) 
  Information about this service can be found <a href="$encoder.encodeForHTMLAttribute($infoURL)"/>here</a>
#end

Parameters

No parameter should be specified.

Specification

The given name are surname are defined in the SAML Metadata Login and Discover UI Extensions specification.

This returns the "best fit" URL specified for the logo of the relying party (if one exists in the metadata extensions). The URL scheme is limited to http:, https: and data:. Other types will not render but will result in an error message in the log.

Note that the specification allows for a logo to provided with no language associated.  If an logo for an appropriate language exists then this is returned, otherwise the no-language logo is returned (assuming that it fits the size constraints as detailed below).

Parameters

Two forms exist.  The first four parameters are supplied these are (respectively) the minimum width, the minimum height, the maximum width and the maximum height (in pixels) that the logo can be.  

The second form has no parameter and any logo which fits the language constraints is returned.

Example
#set ($logo=$rpUIContext.logo)
#set ($serviceName=$rpuiContext.serviceName)
#if ($logo) 
  <img src="$encoder.encodeForHTMLAttribute($logo)" alt="$encoder.encodeForHTMLAttribute($serviceName)"/>
#end

Specification

The logo is defined in the SAML Metadata Login and Discover UI Extensions specification.

$rpUIContext.organizationDisplayName

This returns the (language specific) OrganizationDisplayName if it exists in the metadata for the relying party.  

Example
#set ($odn=$rpUIContext.organizationDisplayName)
#if ($odn)
  $encoder.encodeForHTML($odn)
#end

Parameters

No parameter should be specified.

Specification

The OrganizationDisplayName is defined in the  SAML Metadata specifciation

$rpUIContext.organizationName

This returns the (language specific) OrganizationName if it exists in the metadata for the relying party.  

Example
#set ($on=$rpUIContext.organizationName)
#if ($on)
  $encoder.encodeForHTML($on)
#end

Parameters

No parameter should be specified.

Specification

The OrganizationName is defined in the  SAML Metadata specifciation

$rpUIContext.organizationURL

This returns the (language specific) OrganizationURL URL if it exists in the metadata for the relying party. The URL scheme is limited to http: and https:.  Other types will not render but will result in an error message in the log.

Example
#set ($ourl=$rpUIContext.organizationURL)
#set ($odn=$rpUIContext.organizationDisplayName)
#if ($ourl && $odn)
  <a href="$encoder.encodeForHTMLAttribute($ourl)">$encoder.encodeForHTML($odn)</a>
#end

Parameters

No parameter should be specified.

Specification

The OrganizationURL is defined in the  SAML Metadata specifciation

$rpUIContext.privacyStatementURL

This returns the (language specific) PrivacyStatementURL URL if it exists in the extensions of the metadata for the relying party. The URL scheme is limited to http: and https:.  Other types will not render but will result in an error message in the log.

Example
#set ($psurl=$rpUIContext.privacyStatementURL)
#if ($psurl)
  <a href="$encoder.encodeForHTMLAttribute($psurl)">Privacy Statement</a>
#end

Parameters

No parameter should be specified.

Specification

The PrivacyStatementURL is defined in the   SAML Metadata Login and Discover UI Extensions specification.

$rpUIContext.serviceDescription

This returns the (language specific) description of the service.

The description is located as follows:

  • For every possible language
    • Search the metadata extensions for the relying party for a matching Description, return this is found
    • Search the AttributeConsumingService for the request (which will be part of the metadata for the relying party) for a matching ServiceDescription, return this if found
  • Otherwise return null


Example
#set ($desc = $rpUIContext.getServiceDescription())
#if ($desc)
  $encoder.encodeForHTML($desc)
#end

Parameters

No parameter should be specified.

Specification

The Description is defined in the   SAML Metadata Login and Discover UI Extensions specification.

The ServiceDescription is defined in the  SAML Metadata specifciation

$rpUIContext.serviceName

This will always return a value.  As for the serviceDescription, the search is compound through both the metadata and the metadata extensions

The Service Name is located as follows:

  • For every possible language
    • Search the metadata extensions for the relying party for a matching DisplayName, return this is found
    • Search the AttributeConsumingService for the request (which will be part of the metadata for the relying party) for a matching ServiceName, return this if found
  • Otherwise return a name derived from the EntityID of the relying party
    • If the EntityID is a URI (which it should be) and has a schema of http: or https: return the hostname from the URI.
    • Otherwise return the entityID in full

For example, absent appropriate metadata https://sp.example.org/shibboleth would return sp.example.org, whilst urn:mace:edu.internet:provider:identity:uni.edu  would be pass unchanged.

Example
#set ($rpContext = $profileRequestContext.getSubcontext('net.shibboleth.idp.profile.context.RelyingPartyContext'))
#set ($serviceName = $rpUIContext.serviceName)
// Do not diplay anything if there is no metadata support
#if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
  <legend>
    #springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)
  </legend>
#end

Parameters

No parameter should be specified.

Specification

The DisplayName is defined in the   SAML Metadata Login and Discover UI Extensions specification.

The ServiceName is defined in the  SAML Metadata specifciation