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/.
Setting Up the Sample Webapp
To obtain and configure the Playground sample, follow the steps below.
You can check out the repository of the OAuth 2.0 sample from GitHub. Follow the instructions here to checkout the folder. We refer <SAMPLE_HOME> as the modules/samples folder inside the folder where the product-is repository is checked out.
https://github.com/wso2/product-is/tree/master/modules/samples/oauth2/playground2
In your command line, navigate toÂ
<SAMPLE_HOME>/oauth2/playground2
 in the folder you checked out and build the sample using the following command. You must have Apache Maven installed to do this (see Installation Prerequisites for the appropriate version to use).mvn clean install
After successfully building the sample, a .
war
file named playground2 can be found inside theÂ<SAMPLE_HOME>/oauth2/playground2/targetÂ
folder. Deploy this sample web app on a web container. To do this, use the Apache Tomcat server.Since this sample is written based on Servlet 3.0 it needs to be deployed on Tomcat 7.x.
Use the following steps to deploy the web app in the web container:
- Stop the Apache Tomcat server if it is already running.
- Copy theÂ
playground2.warÂ
file to theÂ<TOMCAT_HOME>/webapps
 folder. - Start the Apache Tomcat server.
Make sure to update param-value the following parameter in theÂ
WEB-INF/web.xml
 file with the server url of the Identity Server if required.<init-param> <description>serverUrl</description> <param-name>serverUrl</param-name> <param-value>https://localhost:9443/services/</param-value> </init-param>
Note thatÂ
localhost
 is the server that hosts WSO2 Identity Server andÂ9443
 is the default SSL port of it.Update param-value of below parameters with credentials of an admin user if required.
<init-param> <description>userName</description> <param-name>userName</param-name> <param-value>admin</param-value> </init-param> <init-param> <description>password</description> <param-name>password</param-name> <param-value>admin</param-value> </init-param>
- 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 the following page appears.
This application is used to request access tokens using the four OAuth2 grant types.Â