This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Logging in to Salesforce with Integrated Windows Authentication
The WSO2 Identity Server supports a wide array of authentication and authorization mechanisms. The application authentication framework of the Identity Server is capable of translating between heterogeneous authentication protocols and transforming and mediating any identity assertion.
Integrated Windows Authentication (IWA) is an authentication mechanism introduced by Microsoft to authenticate users in Microsoft Windows NT-based operating systems. IWA authentication provides an easier way for users to log in to applications that use Windows Active Directory as an userstore. It is a popular choice of authentication among Windows server users and administrators, since it eliminates the need of remembering extra credentials of the users, and reduces the authentication overhead for the server administrators.
This topic provides instructions on how to configure WSO2 Identity Server to authenticate Salesforce users using Integrated Windows Authentication.
See the following links for related documentation.
- See Integrated Windows Authentication and Configuring IWA Single-Sign-On for more information on Integrated Windows Authentication and details on how to enable it in the Identity Server.
The following sections list out the instructions on how to configure this.
Configuring Salesforce
- Sign up as a Salesforce developer.
- Fill out the relevant information found in the following URL: https://developer.salesforce.com/signup
- Click Sign me up.
- You will receive a security token by email to confirm your new account. If you did not receive the email successfully, you will be able to reset it by following the steps given here.
- Fill out the relevant information found in the following URL: https://developer.salesforce.com/signup
- Log in with your new credentials as a Salesforce developer. Do this by clicking Login link in the top right hand side of https://developer.salesforce.com/.
- Click Allow to enable Salesforce to access your basic information.
Once you are logged in, create a new domain and access it.
Tip: This step is required only if the validation request is sent by the service provider. For identity provider initiated validation requests, this is not required.
To do this, do the following steps.
- Go to Domain Management in the left navigation pane and click My Domain.
- In the page that appears, come up with a name for your domain. You can check if the domain is available by clicking the Check Availability button.
Check and agree with the Terms and Conditions before clicking Register Domain to register your new domain.
Tip: The registration process may take some time. Use this time to get familiar with Salesforce and read through the Salesforce developer documentation.
- Once the domain is registered to your account, click the Click here to login button to test this out.
- On the left navigation menu, go to Security Controls and click Single Sign-On Settings.
- In the page that appears, click Edit and then select the SAML Enabled checkbox to enable federated single sign-on using SAML.
- Click Save to save this configuration change.
Click New under SAML Single Sign-On Settings. The following screen appears.
Ensure that you configure the following properties.Field Value Name SSO API Name SSO Issuer localhost
Note: In this case we have localhost as the Issuer as this topic is a sample of how this should work. In a production environment where you need to run this scenario, you must have the domain name or host name of the server that you are hosting the WSO2 Identity Server.
Entity Id http://saml.salesforce.com Identity Provider Certificate wso2.crt
Note: To create the Identity Provider Certificate, open your Command Line interface, traverse to the
<IS_HOME>/repository/resources/security/
directory. Next you must execute the following command.Keytool -export -alias wso2carbon -file wso2.crt -keystore wso2carbon.jks -storepass wso2carbon
Once this command is run, the wso2.crt file is generated and can be found in the
<IS_HOME>/repository/resources/security/
directory. Click Choose File and navigate to this location in order to obtain and upload this file.Request Signing Certificate From the dropdown, you must select the public certificate of Salesforce. If you have not created this already, check step 15 of this section for details on how to create the certificate. Request Signature Method RSA-SHA1 Assertion Decryption Certificate Assertion not encrypted SAML Identity Type Assertion contains User's salesforce.com username
SAML Identity Location Identity is in the NameIdentifier element of the Subject statement
Identity Provider Login URL https://localhost:9443/samlsso
Note: In this case we have localhost as the URL as this topic is a sample of how this should work. In a production environment where you need to run this scenario, you must have the domain name or host name of the server that you are hosting the WSO2 Identity Server.
Identity Provider Logout URL https://localhost:9443/samlsso
Note: In this case we have localhost as the URL as this topic is a sample of how this should work. In a production environment where you need to run this scenario, you must have the domain name or host name of the server that you are hosting the WSO2 Identity Server.
Custom Error URL Leave blank Service Provider Initiated Request Binding
HTTP POST User Provisioning Enabled Leave blank - Click Save to save your configurations.
- Go to Domain Management in the left navigation pane and click My Domain.
- Click Deploy to Users. Click Ok to the confirmation message that appears.
- In the page that appears, you must configure the Authentication Configuration section. Scroll down to this section and click Edit.
- Under Authentication Service, select SSO instead of Login Page.
- Click Save.
Next you need to obtain the Salesforce certificate and upload it to the Identity Server.
About the Salesforce certificate
The validation request sent from Salesforce must be validated by the Identity Server. For this purpose, the Salesforce public certificate must be uploaded to the Identity Server and is used to validate the request.
Do the following steps to obtain the certificate.
- On the left navigation menu, go to Security Controls and click Certificate and Key Management.
- If you have not done so already, you must create the certificate first. Do the following steps to create this.
- Click Create Self-Signed Certificate.
- Enter the Label and a Unique Name and click Save. The certificate is generated.
- Click the Download Certificate button to download the certificate.
Configuring the service provider
- Sign in. Enter your username and password to log on to the management console.
- Navigate to the Main menu to access the Identity menu. Click Add under Service Providers.
- Fill in the Service Provider Name and provide a brief Description of the service provider. Only Service Provider Name is a required field and we use Salesforce as the name for this example.
- Click Register.
- Expand the Inbound Authentication Configuration and the SAML2 Web SSO Configuration and click Configure.
In the form that appears, fill out the following configuration details required for single sign-on.
See the following table for details.Field Value Description Issuer https://saml.salesforce.com This is the <saml:Issuer>
element that contains the unique identifier of the service provider. This is also the issuer value specified in the SAML Authentication Request issued by the service provider. When configuring single-sign-on across Carbon servers, ensure that this value is equal to the ServiceProviderID value mentioned in the<IS_HOME>/repository/conf/security/authenticators.xml
file of the relying party Carbon server.Assertion Consumer URL https://identityprovisioning-dev-ed.my.salesforce.com?so=00D90000000ySEn This is the URL to which the browser should be redirected to after the authentication is successful. This is the Assertion Consumer Service (ACS) URL of the service provider. The identity provider redirects the SAML2 response to this ACS URL. However, if the SAML2 request is signed and SAML2 request contains the ACS URL, the Identity Server will honor the ACS URL of the SAML2 request. In this case, you must use your Salesforce login URL. In Salesforce, click Security Controls on your left menu and then click Single Sign-On Settings. In the page that appears, click on the SSO settings that you created to view the details. Use the Salesforce Login URL listed there for this value. NameID Format The default value can be used here. This defines the name identifier formats supported by the identity provider. The service provider and identity provider usually communicate with each other regarding a specific subject. That subject should be identified through a Name-Identifier (NameID) , which should be in some format so that It is easy for the other party to identify it based on the format. Name identifiers are used to provide information regarding a user. Use fully qualified username in the NameID Selected A fully qualified username is basically the user name with the user store domain. In short, the username must be in the following format: {user store domain}{user name}
.Enable Response Signing Selected Select Enable Response Signing to sign the SAML2 Responses returned after the authentication process.
Enable Assertion Signing Selected Select Enable Assertion Signing to sign the SAML2 Assertions returned after the authentication. SAML2 relying party components expect these assertions to be signed by the Identity Server.
Enable Attribute Profile Selected Select Enable Attribute Profile to enable this and add a claim by entering the claim link and clicking the Add Claim button. The Identity Server provides support for a basic attribute profile where the identity provider can include the user’s attributes in the SAML Assertions as part of the attribute statement. Once you select the checkbox to Include Attributes in the Response Always, the identity provider always includes the attribute values related to the selected claims in the SAML attribute statement. - Click Register to save your configurations.
Since Salesforce user names are actually email addresses, we must configure the Identity Server for email authentication. Do the following steps to achieve this.
Open the
<IS_HOME>/repository/conf/carbon.xml
file and make the following change to the configuration.<EnableEmailUserName>true</EnableEmailUserName>
Open the
<IS_HOME>/repository/conf/user-mgt.xml
file and add the following property under the user store manager configurations. Using above property, you can change the pattern of your email address. By default it must be more than 3 characters and less than 30, but you can configure it as you wish.<Property name="UsernameWithEmailJavaScriptRegEx">^[\S]{3,30}$</Property>
- Restart the Identity Server.