This page provides instructions for configuring a SAML Service Provider (SP) to use the UW Social Gateway. The target audience is SP operators who want to enable sign-on to an application using Google and/or Facebook credentials. Examples are provided for SAML SPs using Shibboleth software.
The Service Provider Registry provides an interface to register SPs to use the new UW Social gateway. By configuring an SP to use the gateway, it is possible for the SP to consume credentials from social identity providers while using only the SAML protocol. The UW Social gateway acts an intermediary and translator between SAML protocol used by the SP and native protocols used by social identity providers. This approach is an alternative to installing additional software on the SP that implements native support for social login protocols.
- Sign up for the service.
- Browse to the Service Provider Registry.
- Find your SP.
- Select the Gateways tab.
- Click Edit.
- In the dialog window that pops up check the "Allow Social logins" box.
- Click Save Changes.
- Configure the metadata source.
- Add the UW Social Gateway's IdP metadata location to your SP's metadata provider configuration. If you use Shibboleth SP software you will add this after the InCommon <MetadataProvider> block--see example 1 or 2 below. Note: The Shibboleth SP is sometimes unable to fetch the metadata from this location, so you may want to download a copy of the metadata, place it in the shibboleth configuration file folder, and specify the file name in backingFilePath (see example 1 or 2 for details).
- The UW gateway's Google metadata URL is: https://idp-gw.u.washington.edu/metadata/google-metadata.xml.
The UW gateway's Facebook metadata URL is: https://idp-gw.u.washington.edu/metadata/facebook-metadata.xml.
The metadata at both locations is digitally signed using the UW IdP's signing certificate. If the metadata is downloaded via HTTPS protocol from the location listed above, signature verification is optional. If the metadata is sourced from any other location, signature verification should be configured. See UW IdP Metadata for instructions and certificate download.
- Configure a session initiator to invoke a Google or Facebook sign-in
- For Google sign-on, the target entityID will be https://idp-gw.u.washington.edu/google.
- For Facebook sign-on, the target entityID will be https://idp-gw.u.washington.edu/facebook.
- Example 3 demonstrates a SessionInitiator configuration element for Shibboleth SP software.
- Configure a location to trigger a Google or Facebook sign-in using a session initiator.
- Example 4 demonstrates an .htaccess configuration for Shibboleth SPs under Apache.
- Example 5 demonstrates how to configure the <RequestMapper> element for Shibboleth SPs under Windows.
<ApplicationDefaults>
...
<!-- metadata URL for Google -->
<MetadataProvider type="XML" url="https://idp-gw.u.washington.edu/metadata/google-metadata.xml"
backingFilePath="/data/apacheconfig/google-metadata.xml"
reloadInterval="7200" >
</MetadataProvider>
<!-- metadata URL for Facebook -->
<MetadataProvider type="XML" url="https://idp-gw.u.washington.edu/metadata/facebook-metadata.xml"
backingFilePath="/data/apacheconfig/facebook-metadata.xml"
reloadInterval="7200" >
</MetadataProvider>
...
</ApplicationDefaults>
<ApplicationDefaults>
...
<!-- metadata URL for Google -->
<MetadataProvider type="XML" url="https://idp-gw.u.washington.edu/metadata/google-metadata.xml"
backingFilePath="google-metadata.xml"
reloadInterval="7200" >
</MetadataProvider>
<!-- metadata URL for Facebook -->
<MetadataProvider type="XML" url="https://idp-gw.u.washington.edu/metadata/facebook-metadata.xml"
backingFilePath="facebook-metadata.xml"
reloadInterval="7200" >
</MetadataProvider>
...
</ApplicationDefaults>
<ApplicationDefaults>
...
<Sessions>
....
<!-- login via saml proxy to Google -->
<SessionInitiator isDefault="false" type="Chaining" id="UWGOOGLE"
Location="/SHIB/idp-proxy-google" relayState="cookie"
entityID="https://idp-gw.u.washington.edu/google"
forceAuthn="false">
<!-- Uncomment the appropriate line below -->
<!-- Windows example -->
<!-- <SessionInitiator type="SAML2" template="bindingTemplate.html"/> -->
<!-- UNIX example -->
<!-- <SessionInitiator type="SAML2" template="/data/local/etc/shibboleth/bindingTemplate.html"/> -->
</SessionInitiator>
<!-- login via saml proxy to Facebook -->
<SessionInitiator isDefault="false" type="Chaining" id="UWFACEBOOK"
Location="/SHIB/idp-proxy-facebook" relayState="cookie"
entityID="https://idp-gw.u.washington.edu/facebook"
forceAuthn="false">
<!-- Uncomment the appropriate line below -->
<!-- Windows example -->
<!-- <SessionInitiator type="SAML2" template="bindingTemplate.html"/> -->
<!-- UNIX example -->
<!-- <SessionInitiator type="SAML2" template="/data/local/etc/shibboleth/bindingTemplate.html"/> -->
</SessionInitiator>
</Sessions>
...
</ApplicationDefaults>
# Google example
authtype shibboleth
shibrequiresession on
shibRequireSessionWith UWGOOGLE
require valid-user
# Facebook example
authtype shibboleth
shibrequiresession on
shibRequireSessionWith UWFACEBOOK
require valid-user
<RequestMapper type="Native">
<RequestMap>
<!--
The example requires a session for documents in /secure on the containing host with http and
https on the default ports. Note that the name and port in the <Host> elements MUST match
Apache's ServerName and Port directives or the IIS Site name in the <ISAPI> element above.
<Host name="app.example.org" redirectToSSL="443">
-->
<Host name="app.example.org" redirectToSSL="443">
<Path name="secure" authType="shibboleth" requireSession="true"/>
<Path name="secure2" authType="shibboleth" requireSessionWith="UWGOOGLE" requireSession="true"/>
<Path name="secure3" authType="shibboleth" requireSessionWith="UWFACEBOOK" requireSession="true"/>
</Host>
</RequestMap>
</RequestMapper>
The social gateway releases a SAML nameid formatted as an email address.
The attributes listed in Table 1 will be returned from the social gateway to the SP in the authentication response. For Shibboleth SPs, the SAML urns are mapped to attribute names in the attribute-map.xml file. See Configure a Service Provider to Use Attributes for more information on attribute mapping..
Table 1. Attributes released by the social gateway. The Google and Facebook names are listed for reference. An SP using the gateway will only see the friendly name and the SAML URN.
1The eduPersonTargetedID is created by the gateway using a function based on the Google subject or the Facebook ID field.