Skip to content

Sample WS-Federation web app

By following this guide, you will be able to deploy a WS-Federation-based web application and enable login for it using the Passive Security Token Service (Passive STS) of WSO2 Identity Server.


WSO2 Identity Server uses its passive security token service (Passive STS) as its WS-Federation implementation. Passive STS is capable of issuing SAML 1.1 and 2.0 security tokens. To request a SAML 2.0 security token, the Request Security Token (RST) should be sent to the passive STS endpoint with the token type, SAMLV2.0. If no RST is specified, WSO2 Identity Server issued a SAML 1.1 token by default.


  • Download Apache Tomcat 8.x and install it. Tomcat server installation location will later be referred to as <TOMCAT_HOME> in this guide.

  • It is recommended that you use a hostname that is not localhost to avoid browser errors. Modify your machine's /etc/hosts entry to reflect this.


    Note that wso2is.local is used in this documentation as an example, but you must modify this when configuring the authenticators or connectors with this sample application.

  • Download the Passive STS Sample application from the latest release assets.

Deploy the sample app

To deploy the sample web app on a web container:

  1. Copy the application's downloaded .war file into the webapps directory of the Tomcat folder.

  2. Start the Tomcat server.

Configure sample properties

To configure additional properties for the sample application:

  1. Add the following configurations to the web.xml file in <TOMCAT_HOME>/apache-tomcat-<version>/webapps/PassiveSTSSampleApp/WEB-INF.

    • Specify idpUrl as the Identity Server's Passive STS URL.


    • Specify the replyURL as the URL of the web app.


    • Specify the realm as a unique identifier for the web app.


  2. Restart the tomcat server.

Configure the service provider

  1. On the WSO2 Identity Server Console, go to Applications.

  2. Click New Application and select Standard-Based Application.

  3. Enter the following details:

    Create a new Passice STS app

    Name Give a unique name to identify your application.


    Protocol Select WS-Federation.
    Realm This should be a unique identifier for the web app. Provide the same realm name given to the web app you are configuring WS-Federation for.


    Reply URL Provide the URL of the web app you are configuring WS-Federation for. This endpoint URL will handle the token response.


  4. Click Register to complete the registration.

  5. Go to the User Attributes tab and click Add User Attribute, and add the following attributes:

  6. Select as the Subject attribute.

  7. Click Update to save your configurations.


Currently, the signing algorithm used for WS-Federation by default is rsa-sha1, and the digest algorithm used is sha1. To change the default algorithms, add the following configuration in the deployment.toml file found in the <IS_HOME>/repository/conf directory. The example given below sets the signing algorithm to rsa-sha256 and the digest algorithm to sha256.

signature_algorithm = ""
digest_algorithm = ""

Try it out


When redirecting your users to WSO2 IS Passive STS endpoint, the following (optional) parameters are sent in the request from the sample application.

  • wa=wsignin1.0: specifies whether WSO2 IS should issue a token for the relying party (this is the default action).
  • wa=wsignout1.0: specifies whether WSO2 IS should log the user out.
  • wreply={replyUrl}: specifies where the response should be sent.

Using a Network tracer such as a SAML tracer is recommended to analyze the HTTP request and responses in this scenario. With a tracer, you will be able to view the parameters mentioned above and also see the SAML token that is issued from WSO2 IS.

  1. Access one of the following links on your browser and click Login.

  2. Login using your credentials.

  3. Provide the required consent. You will be redirected to the WSO2 IS WS-Federation Service and then redirected back to the configured replyUrl.

You will see the WS-Federation response with the requested claims on the screen.