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/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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

  1. Download the Playground sample from here.
  2. Generate the playground2.0.war file and copy it to the TOMCAT_HOME/webapps directory. To generate the .war file you must run the following Apache Maven command in the sample's location using the command line.

    mvn clean install
  3. Make sure to update the following parameters in the WEB-INF/web.xml file.

    <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>
  4. localhost is the server that hosts WSO2 API Manager and 9443 is the default SSL port of it.
  5. Update param-value of setup to AM as shown below.

    <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>
  6. 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.

This application is used to request access tokens using the four OAuth2 grant types. 

  • No labels