Chapter 19. Using JBoss Portal SSO with Salesforce and Google Apps
- 19.1. JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
- 19.1.1. IDP (JBoss Portal) and SP (Salesforce) Prerequisites
- 19.1.2. Obtain a Salesforce developerforce Account
- 19.1.3. Creating a Salesforce Domain
- 19.1.4. Configure SAML SSO SP Settings
- 19.1.5. Import Message Signing Certificate into Salesforce
- 19.1.6. Create Salesforce and Portal Users
- 19.1.7. Obtain the Salesforce Client Certificate
- 19.1.8. Configure JBoss Portal as the IDP
- 19.1.9. Test the IDP (JBoss Portal) and SP (Salesforce) Configuration
- 19.2. JBoss Portal as the Identity Provider (IDP) and Google Apps as the Service Provider (SP)
- 19.2.1. IDP (JBoss Portal) and SP (Google Apps) Prerequisites
- 19.2.2. Create A Google Apps for Business Account
- 19.2.3. Create Default Google Apps for Business Users
- 19.2.4. Configuring Google Apps as the SP
- 19.2.5. Configuring JBoss Portal as the IDP
- 19.2.6. Testing the IDP (JBoss Portal) and SP (Google Apps) Configuration
- 19.3. Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
- 19.3.1. IDP (Salesforce) and SP (JBoss Portal) Prerequisites
- 19.3.2. Obtain a Salesforce developerforce Account
- 19.3.3. Creating a Salesforce Domain
- 19.3.4. Disable SP Single Sign-on in Salesforce
- 19.3.5. Create and Apply a Salesforce IDP Message Signing Certificate
- 19.3.6. Create Salesforce and Portal Users
- 19.3.7. Configuring Salesforce as the IDP
- 19.3.8. Configuring JBoss Portal as the SP
- 19.3.9. Testing the IDP (Salesforce) and SP (JBoss Portal) Configuration
- Scenario One
- Using JBoss Portal as the SAML Identity Provider (IDP) and Salesforce as the SAML Service Provider (SP).
- Scenario Two
- Using JBoss Portal as the IDP and Google Apps as the SP.
- Scenario Three
- Using Salesforce as the IDP and JBoss Portal as the SP.
19.1. JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
19.1.1. IDP (JBoss Portal) and SP (Salesforce) Prerequisites
Prerequisites
- Understand file path abbreviations described in Section 12.1, “File Name Conventions”.
- Configure the Keystore using the suggested password in Section 18.4, “Implementing Keystores”.
19.1.2. Obtain a Salesforce developerforce Account
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Task: Create a new Salesforce developerforce Account
- Visit http://developer.force.com/.
- Click to open the Sign up form.
- Complete the fields, and choose a user name to access the Developer Edition Account with.
- Click to submit the registration details.
- Complete registration by clicking the confirmation link in the email sent to your specified email account.
19.1.3. Creating a Salesforce Domain
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Task: Create a Salesforce Domain
- Log onto
http://developer.force.com. - Click the user name in the top right corner of the page.
- Click ++
- Specify the name of the Salesforce domain, following the suggested format in the My Domain screen.
- Save the details to complete domain registration.
19.1.4. Configure SAML SSO SP Settings
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Task: Configure Salesforce SAML SSO Settings
- Log onto
http://developer.force.com. - Click the user name in the top right corner of the page.
- Click ++
- Configure the following fields and settings:
- SAML Enabled
- Ensure the check box is marked.
- SAML Version
- Specify 2.0 as the value.
- Issuer
- Specify the issuer as
http://www.idp.com:8080/portal/dologin, which is used as the Identity Provider for the Salesforce domain. - Identity Provider Login URL
- Specify the Identity Provider as
http://www.idp.com:8080/portal/dologin, which is the URL Salesforce SAML SSO sends the SAML Requests for authentication. - Identity Provider Logout URL
- Set this value to
http://www.idp.com:8080/portal/dologin. If you have a custom page that users are directed to when they log out, this field can contain the URL of the page. - SAML User ID Type
- Set this value to .
- SAML User ID Location
- Set this value to .
- Entity ID
- Set this value to .
- Service Provider Initiated Request Binding
- Set this value to .
19.1.5. Import Message Signing Certificate into Salesforce
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Task: Import the JBoss Portal Message Signing Certificate into Salesforce
- Use the secure-keystore.jks SAML message signing keystore in the
JPP_IDP_HOME/gatein/gatein.ear/portal.war/WEB-INF/classes/sso/samldirectory to create a certificate.- In the
/samldirectory, runkeytool -export -file portal-idp.crt -keystore secure-keystore.jks -alias secure-key. - When prompted, provide the keystore password
keystorepass.This password is the default suggested password created as part of the Section 18.4, “Implementing Keystores” process. If you chose a different password, ensure this is provided at the prompt.
The command will generate a certificate namedportal-idp.crt. - Import the
portal-idp.crtfile into Salesforce.On http://developer.force.com, click the user menu, and then click → → → .Import theportal-idp.crtcertificate into Salesforce, and set the alias tosecure-key.
19.1.6. Create Salesforce and Portal Users
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Create identical Salesforce and Portal Users
- Create the following users in JBoss Portal, following the instructions in the Register New Accounts chapter in the User Guide.
- Mary CitizenUser name of
Mary. - John CitizenUser name of
John.
- Create the following users in Salesforce, following the instructions in the Salesforce Wiki Documentation located at http://login.salesforce.com/help/doc/en/adding_new_users.htm.
Important
The Federation ID of users in Salesforce must be identical to the user name in JBoss Portal.- Mary CitizenFederation ID of
Mary.User name ofmary@example.com. - John CitizenFederation ID of
John.User name ofjohn@example.com.
19.1.7. Obtain the Salesforce Client Certificate
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Task: Download the Salesforce Client Certificate
proxy-salesforce-com.123 is required to sign SAML assertions, and the public key is required to verify the SAML assertions sent from Salesforce are genuine on the client side.
- Review the information on http://wiki.developerforce.com/page/Client_Certificate.
- Download the certificate from the link in the What do I do next? section of the wiki page.
- Extract the certificate chain archive to a working directory to gain access to the
proxy-salesforce-com.123file.
19.1.8. Configure JBoss Portal as the IDP
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Task: Configuring JBoss Portal as the Identity Provider for Salesforce
- Login to http://developer.force.com.
- From the user menu, click → → → to download the Service Provider metadata from Salesforce.
- Download the Salesforce metadata file to
JPP_IDP_HOME/gatein/gatein.ear/portal.war/WEB-INF/sp-metadata.xml. - In the directory where the
proxy-salesforce.com.123certificate is saved, run thekeytool -import -keystore secure-keystore.jks -file proxy-salesforce-com.123 -alias salesforce-certcommand to import the Salesforce client certificate into the portal keystore. - Open
JPP_IDP_HOME/gatein/gatein.ear/portal.war/WEB-INF/conf/sso/saml/picketlink-idp.xmland add the following ValidatingAlias directive.<ValidatingAlias Key="saml.salesforce.com" Value="salesforce-cert" />
- In the
picketlink-idp.xmlfile, declare the Metadata Provider directive immediately after the </KeyProvider> directive.<!-- Preceeding content removed for readability--> </KeyProvider> <MetaDataProvider ClassName="org.picketlink.identity.federation.core.saml.md.providers.FileBasedEntitiesMetadataProvider"> <Option Key="FileName" Value="/WEB-INF/sp-metadata.xml"/> </MetaDataProvider>
- Open
JPP_IDP_HOME/gatein/gatein.ear/portal.war/WEB-INF/sp-metadata.xmland add the single logout service and entities descriptor blocks. <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" <!-- Comment #1 --> Location="[Salesforce.com Single Logout URL]" index="0" isDefault="true"/> <md:EntitiesDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"> <md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://saml.salesforce.com" <!-- Comment #2 --> </md:EntityDescriptor> </md:EntitiesDescriptor>
- Comment #1
- The Location URL is unique to every Salesforce domain. Obtain the URL specific to the configured domain from the Salesforce.com Single Logout URL field on the Salesforce Federated ID page.
- Comment #2
- Note that other entity descriptions may be present in this block. Examples of entity descriptions that would belong in this block include the Google Apps entity description, which is configured in another scenario.
- Declare the trusted domains
sp.comandidp.cominJPP_IDP_HOME/standalone/configuration/gatein/configuration.propertiesgatein.sso.sp.domains=sp.com,idp.com,salesforce.com
19.1.9. Test the IDP (JBoss Portal) and SP (Salesforce) Configuration
Previous Step in JBoss Portal as the Identity Provider (IDP) and Salesforce as the Service Provider (SP)
Task: Testing the IDP and SP Configuration
Note
- Visit the Salesforce domain. For example, https://yourdomain.my.salesforce.com.
- Once redirected to the JBoss Portal login screen (for example, http://www.idp.com:8080/portal/dologin), enter the user credentials for a user with a Salesforce Federated ID.
- Once redirected back to Salesforce, verify that the user is authenticated as their Salesforce Federated ID.
Note
19.2. JBoss Portal as the Identity Provider (IDP) and Google Apps as the Service Provider (SP)
19.2.1. IDP (JBoss Portal) and SP (Google Apps) Prerequisites
Prerequisites
- Understand file path abbreviations described in Section 12.1, “File Name Conventions”.
- Be familiar with the content available at http://www.google.com/enterprise/apps/business/.
- Configure JBoss Portal to act as the SAML IDP as described in Section 19.1.8, “Configure JBoss Portal as the IDP”.
19.2.2. Create A Google Apps for Business Account
Previous Step in JBoss Portal as the Identity Provider (IDP) and Google Apps as the Service Provider (SP)
Creating a Google Apps for Business Account
- Click .
- Complete the fields on the About you form as suggested by the field help.
- On the Your Business Domain Address screen, make a selection based on your requirements.
- Use your own domain
- Choose this option if you intend to configure Google Apps for Business for production use.
- mygbiz.com Domain (recommended for this example process)
- Choose this option if you are experimenting with SSO, and do not want to affect your primary business domain. You can upgrade the account to use a domain you own any time after testing out the functionality.
- If you choose the recommended free domain option, provide a unique name for the domain in the field, and click .
- On the Create your Google apps account form, provide the information requested.
- Click Accept and signup.
- Verify you can access your account by authenticating using the credentials you created as part of this procedure.If successful, the Google Admin Console will display.
19.2.3. Create Default Google Apps for Business Users
Create Identical Google Apps for Business and Portal Users
- Create the following users in JBoss Portal, following the instructions in the Register New Accounts chapter in the User Guide.
- Mary CitizenUser name:
mary - John CitizenUser name:
john
- From the Google Admin Console, click .
- Click , and select .
- Create the following users in Google Apps for Business.
Important
The user names set for users in Google Apps must be identical to those in JBoss Portal because the portal user name is connected with the Google Apps user name.- Mary CitizenPrimary email address:
mary@[domain].mygbiz.com.This creates a user name ofmaryand an email address ofmary@[domain].mygbiz.com. - John CitizenPrimary email address:
john@[domain].mygbiz.com.This creates a user name ofjohnand an email address ofjohn@[domain].mygbiz.com.
19.2.4. Configuring Google Apps as the SP
Previous Step in JBoss Portal as the Identity Provider (IDP) and Google Apps as the Service Provider (SP)
Task: Configuring Google Apps for Business as the Service Provider.
- Open https://admin.google.com and sign-in if necessary.
- If the Security icon is not visible, click More Controls and drag the Security icon onto the Admin console main screen.
- Click + → .
- In the Set up single sign-on (SSO) form, configure the following fields and settings:
- Enable Single Sign-on
- Select the tick box.
- Sign-in page URL
- Specify the sign-in page as
http://www.idp.com:8080/portal/dologin. - Sign-out page URL
- Specify the sign-out page as
http://www.idp.com:8080/portal/dologin. - Change password URL
- Specify the change password page as
http://www.idp.com:8080/portal/dologin. - Verification certificate
- Export certificates from the JBoss Portal keystore into a file (for example,
portal-idp.crt), and upload the certificate into the form.Exporting certificates from the JBoss Portal keystore is described in Section 19.1.5, “Import Message Signing Certificate into Salesforce”. - Use a domain specific issuer
- Select the tick box.
- Verify all settings are correct, and click .
19.2.5. Configuring JBoss Portal as the IDP
Previous Step in JBoss Portal as the Identity Provider (IDP) and Google Apps as the Service Provider (SP)
Task: Configuring JBoss Portal as the Identity Provider for Google Apps
- In the
JPP_IDP_HOME/gatein/gatein.ear/portal.war/WEB-INF/conf/sso/saml/picketlink-idp.xmlfile, declare the Metadata Provider directive immediately after the </KeyProvider> directive.<!-- Preceeding content removed for readability--> </KeyProvider> <MetaDataProvider ClassName="org.picketlink.identity.federation.core.saml.md.providers.FileBasedEntitiesMetadataProvider"> <Option Key="FileName" Value="/WEB-INF/sp-metadata.xml"/> </MetaDataProvider>
- Open
JPP_IDP_HOME/gatein/gatein.ear/portal.war/WEB-INF/sp-metadata.xmland specify that SAML requests from the Google Apps for Business SP will not be signed. <md:EntitiesDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"> <!-- Comment#1 --> <md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="google.com/a/[domain.mygbiz.com]" validUntil="2022-06-13T21:46:02.496Z"> <!-- Comment#2 --> <md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" /> </md:EntityDescriptor> </md:EntitiesDescriptor>
- Comment #1
- The entityID="google.com/a/[domain.mygbiz.com]" [domain.mygbiz.com] value must be replaced with the domain name specified in Section 19.2.2, “Create A Google Apps for Business Account”
- Comment #2
- Adding the
AuthnRequestsSignedattribute as described prevents SAMLRequests from being validated. This is necessary because Google Apps for Business does not add signatures to its SAML Requests.
- Declare the trusted domains
sp.com,idp.comandgoogle.cominJPP_IDP_HOME/standalone/configuration/gatein/configuration.properties. If other domains are declared for this parameter, append the trusted domains to the line.gatein.sso.sp.domains=sp.com,idp.com,google.com
- In the
JPP_IDP_HOME/gatein/gatein.ear/portal.war/WEB-INF/conf/sso/saml/picketlink-idp.xmlfile, declare a ValidatingDomain directive.<ValidatingAlias Key="127.0.0.1" Value="secure-key"/>
Note
Even though Google SAMLRequests are not signed, PicketLink requires that each SAMLRequest must have a key. When a key is not found for a specific domain (in this case google.com), PicketLink will search for keys with the alias127.0.0.1
19.2.6. Testing the IDP (JBoss Portal) and SP (Google Apps) Configuration
Prerequisites:
Previous Step in JBoss Portal as the Identity Provider (IDP) and Google Apps as the Service Provider (SP)
Procedure 19.1.
- Visit the Google Apps domain configured in Section 19.2.2, “Create A Google Apps for Business Account”.The Google Apps domain URL takes the structure https://www.google.com/a/mydomain.mygbiz.com/ServiceLogin. Replace mydomain with the custom value of your domain.
- Once redirected to the JBoss Portal login screen (for example, http://www.idp.com:8080/portal/dologin), enter the JBoss Portal user credentials for a user created in Section 19.2.3, “Create Default Google Apps for Business Users”.
- Once redirected back to the Google Apps domain, verify that the JBoss Portal user is authenticated correctly.
19.3. Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
19.3.1. IDP (Salesforce) and SP (JBoss Portal) Prerequisites
Prerequisites
- Understand file path abbreviations described in Section 12.1, “File Name Conventions”.
- Configure JBoss Portal to act as the SAML SP as described in Section 18.2.2, “Configuring a SAML2 Service Provider”.
19.3.2. Obtain a Salesforce developerforce Account
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Task: Create a new Salesforce developerforce Account
- Visit http://developer.force.com/.
- Click to open the Sign up form.
- Complete the fields, and choose a user name to access the Developer Edition Account with.
- Click to submit the registration details.
- Complete registration by clicking the confirmation link in the email sent to your specified email account.
19.3.3. Creating a Salesforce Domain
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Task: Create a Salesforce Domain
- Log onto
http://developer.force.com. - Click the user name in the top right corner of the page.
- Click ++
- Specify the name of the Salesforce domain, following the suggested format in the My Domain screen.
- Save the details to complete domain registration.
19.3.4. Disable SP Single Sign-on in Salesforce
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Task: Disabling Salesforce SAML SSO Settings
- Log onto
http://developer.force.com. - Click the user name in the top right corner of the page.
- Click ++
- Clear the SAML Enabled tick box to disable all SAML SSO configuration.
19.3.5. Create and Apply a Salesforce IDP Message Signing Certificate
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Task: Generate a Salesforce IDP Message Signing Certificate, and apply it to Salesforce
- Log onto http://developer.force.com.
- Click the user name in the top right corner of the page.
- Click → → → .Any certificates already generated by Salesforce are displayed.
- Click , and specify the following values:
- Label
- salesforce-idp-cert
- Unique Name
- salesforce-idp-cert
- Download the created certificate by clicking the button on the Identity Provider screen. Save the certificate to
/tmp/salesforce_idp_cert.cer. - To apply the created certificate navigate back to the screen and apply the certificate created in the previous step.
19.3.6. Create Salesforce and Portal Users
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Create identical Salesforce and Portal Users
- Create the following users in JBoss Portal, following the instructions in the Register New Accounts chapter in the User Guide.
- Mary CitizenUser name of
Mary. - John CitizenUser name of
John.
- Create the following users in Salesforce, following the instructions in the Salesforce Wiki Documentation located at http://login.salesforce.com/help/doc/en/adding_new_users.htm.
Important
The Federation ID of users in Salesforce must be identical to the user name in JBoss Portal.- Mary CitizenFederation ID of
Mary.User name ofmary@example.com. - John CitizenFederation ID of
John.User name ofjohn@example.com.
19.3.7. Configuring Salesforce as the IDP
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Task: Configuring Salesforce as the Identity Provider
- On the Salesforce home page, click the user name and then click → → →
- Configure the following fields and settings:
- Name
- Specify portal-sp as the value.
- ACS URL
- Specify the Assertion Consumer Service URL as
http://www.sp.com:8080/portal/dologinThis value is the address of the Service Provider, in this case the JBoss Portal instance on the sp.com domain. - Entity ID
- Specify
http://www.sp.com:8080/portal/dologinas the value. - Start URL
- Leave this parameter blank.
- Subject Type
- Set this value to Federation ID.
- Service Provider Certificate
- Use the certificate exported in Section 18.4, “Implementing Keystores”, if you are using the same certificate for the Service Provider and the Identity Provider. For reference, Section 19.1.5, “Import Message Signing Certificate into Salesforce” describes the commands to export the message signing certificate.If not, export the
portal-idp.crtcertificate from the keystore file inJPP_SP_HOME/gatein/gatein.ear/portal.war/WEB-INF/classes/saml/sso/secure-keystore.jks.
19.3.8. Configuring JBoss Portal as the SP
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Configuring JBoss Portal as the Salesforce Service Provider
- Import the certificate created by Salesforce into the JBoss Portal keystore located in
JPP_SP_HOME/gatein/gatein.ear/portal.war/WEB-INF/classes/saml/sso/secure-keystore.jks.Use the commandkeytool -import -file /tmp/salesforce_idp_cert.cer -keystore secure-keystore.jks -alias salesforce-idpto import the certificate. - Open
JPP_SP_HOME/standalone/configuration/gatein/configuration.propertiesand change the gatein.sso properties to values corresponding to the Salesforce domain, and the Portal Platform SP URL.gatein.sso.idp.url=https://[yourdomain].my.salesforce.com/idp/endpoint/HttpPost gatein.sso.sp.url=http://www.sp.com:8080/portal/dologin
- Open
JPP_SP_HOME/gatein/gatein.ear/portal.war/WEB-INF/conf/sso/saml/picketlink-sp.xmland add the ValidatingAlias directive.<ValidatingAlias Key="[yourdomain].my.salesforce.com" Value="salesforce-idp" />
Note
Because the JBoss Portal Service Provider obtains role information from the Picketlink Identity Management database, specific roles-mapping configuration normally configured for delivery in the SAML response is not required.
19.3.9. Testing the IDP (Salesforce) and SP (JBoss Portal) Configuration
Prerequisites:
Previous Step in Salesforce as the Identity Provider (IDP) and JBoss Portal as the Service Provider (SP)
Procedure 19.2. Testing the IDP (Salesforce) and SP (JBoss Portal) Configuration
- Start JBoss Portal on the host (assuming the host set to www.sp.com).
- Open http://www.sp.com:8080/portal, and click .JBoss Portal sends the SAML Request to Salesforce, and redirects to the Salesforce login screen.
- Log onto Salesforce, using valid user name and password information.After providing correct credentials, you are redirected back to the portal home screen. You are authenticated with Salesforce login credentials because your portal user name is mapped to the Federated ID in Salesforce.