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
Before you begin, you must first configure OAuth for a service provider to use this sample.
Add a new service provider.
Sign in. Enter your username and password to log on to the Management Console.
Navigate to the Main menu to access the Identity menu. Click Add under Service Providers.
Fill in the Service Provider Name and provide a brief Description of the service provider. Only Service Provider Name is a required field.
Click Register to add the new service provider.
Expand the Inbound Authentication Configuration section and configure OAuth/OpenID Connect.
You can use the following Callback URL when configuring OAuth for WSO2 Playground: http://wso2is.local:8080/playground2/oauth2client
To obtain and configure the Playground sample, follow the steps below.
You can check out the samples repository from GitHub. Follow the instructions here to checkout the folder.
Theis-samples/modules/samplesdirectory is referred to as<IS_SAMPLES>throughout this guide.Open a terminal window and add the following entry to the
/etc/hostsfile of your machine to configure the hostname.127.0.0.1 wso2is.localIn your command line, navigate to
<SAMPLE_HOME>/oauth2/playground2directory 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 installAfter successfully building the sample, a .
warfile named playground2 can be found inside the<SAMPLE_HOME>/oauth2/playground2/targetfolder. Deploy this sample web app on a web container, such as the Apache Tomcat server.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.warfile to the<TOMCAT_HOME>/webappsfolder.Start the Apache Tomcat server.
Make sure to update the
param-valueparameter in theWEB-INF/web.xmlfile with the server URL of the Identity Server if required.
Make sure to enter the port the application is running on, in the URL. If you have started the Identity Serve with a port offset, then the respective port needs to be configured here.<init-param> <description>serverUrl</description> <param-name>serverUrl</param-name> <param-value>https://localhost:9443/services/</param-value> </init-param>Update param-value parameters below 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://wso2is.local:8080/playground2/
By default Tomcat runs on port 8080. If you have configured it to run on a different port make sure to update the URL and access the playground application.
You are directed to the landing page of the sample application. Click on Import Photos and the following page appears.
Are you getting the error that is given below?
Error
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetThe sample applications do not have a keystore in them. Therefore, after changing the tomcat hostname you might get this error because the public key of the WSO2 Identity Server does not exist in the Java certificate store. For more information on the steps you need to follow to overcome the error, see FAQ.
This application is used to request access tokens using the four OAuth2 grant types: