||
Skip to end of metadata
Go to start of metadata

This sample will demonstrate how SAML SSO can be used to log in to web applications deployed in WSO2 Application Server. Go to this link for more information about using SSO with web applications.

Before you begin:

  1. Ensure that WSO2 Application Server and WSO2 Identity Server are both installed in your system.
  2. The following server configurations should be completed for WSO2 AS and WSO2 IS. The instructions are given here.
    • Generic SSO configurations should be included in the sso-sp-config.properties file stored in the <AS_HOME>/repository/conf/security/ directory.
    • Register SSO service providers in WSO2 IS for each web application.
    • Update the IS and AS hostnames in the <AS>/repository/conf/security/sso-sp-config.properties file and the <IS_HOME>/repository/conf/identity.xml file.
    • In WSO2 IS, update the resident IDP provider Entity Id.
    • Enable the SSOValve in the <AS_HOME>/repository/conf/tomcat/catalina-server.xml file of AS.

Building the sample

  1. Open a command line, and navigate to the <AS_HOME>/samples/SSOValveSample/bar-app directory.
  2. Run the relevant command to deploy the web app:
    • Using Maven

      1. Create a WAR file for the sample using the following command:

        mvn clean install
      2. Deploy the generated WAR file on WSO2 AS with the related logs on the console:

        mvn -Pdeploy
    • Using Ant

      ant
    This will deploy the bar-app web application in AS.
  3. In the same way, navigate to the <AS_HOME>/samples/SSOValveSample/foo-app directory and deploy the foo-app web application.
  4. Start the Application Server and log in to the management console. 
  5. You will find the bar-app and foo-app web applications listed in the Running Applications page.
  6. Start WSO2 Identity Server. 

  7. Now you can run the samples as explained below.

Running the sample

  1. Go to the Running Applications page of AS.
  2. Click Go to URL for the bar-app web application. You will be directed to the following page, which allows you to log into the web application through WSO2 IS:
    SSO log in screen
  3. Sign in to access the application.
  4. Now, go back to the Running Applications page and click Go to URL for the foo-app web application. Note that you will be automatically logged in to the web application without any need to enter credentials. 
  • No labels