Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A web application hosted in Apache Tomcat is used as the client.

  1. Download Checkout the Playground sample from here using SVN.
  2. In the pom.xml file found in the sample you checked out, comment the parent tag and add the groupId.

    Code Block
    languagexml
    <!--parent>
            <groupId>org.wso2.identity</groupId>
            <artifactId>wso2is-identity-samples-oauth2</artifactId>
            <version>5.0.0</version>
            <relativePath>../pom.xml</relativePath>
    </parent-->
    
    
    <groupId>org.wso2.identity</groupId>
  3. To generate the .war file you must run the following Apache Maven command in the sample's location using the command line.

    Code Block
    mvn clean install
  4. Copy the playground2.0.war from here and copy it to the  file to the <TOMCAT_HOMEHOME>/webapps directory to deploy the webapp in Apache Tomcat.

  5. Make sure to update the following parameters in the WEB-INF/web.xml file.

    Code Block
    <servlet>
            <servlet-name>oAuth2ClientServlet</servlet-name>
            <servlet-class>com.wso2.identity.oauth.sample.OAuth2ClientServlet</servlet-class>
            <init-param>
                 <description>serverUrl</description>
                 <param-name>serverUrl</param-name>
                 <param-value>https://localhost:9443/services/</param-value>
    Tip

    Tip: localhost is the server

    which

    that hosts WSO2 API Manager and 9443 is the default SSL port of it.

  6. Update param-value of setup to AM as shown below.

    Code Block
    <servlet>
            <servlet-name>oAuth2AccessResourcePage</servlet-name>
            <jsp-file>/oauth2-access-resource.jsp</jsp-file>
            <init-param>
                <description>setup</description>
                <param-name>setup</param-name>
                <param-value>AM</param-value>
            </init-param>
  7. Restart Apache Tomcat and access http://localhost:8080/playground2.0/ (assuming Tomcat is running on HTTP port 8080). You are directed to the landing page of the sample application. Click on Import Photos and you the following page appears.

...