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

OAuth 2.0 Playground with WSO2 Identity Server

OAuth Core specification supports the following four grant types:

  • Authorization Code Grant (authorization_code)
  • Implicit Grant
  • Resource Owner Password Credentials Grant (password)
  • Client Credentials Grant (client_credentials)

First you need to setup the sample web app. You can download it from here and host it in Tomcat. This can be found at http://localhost:8080/playground. If the Identity Server is not running on 9443 - then you need to edit the web.xml of the web app appropriately. Then you need to download the WSO2 Identity Server from here.

  1. Start the WSO2 Identity Server.
  2. Sign in. Enter your username and password to log on to the Management Console.
  3. Click the Main button to access the Manage menu.
  4. From the Manage menu, select OAuth.
  5. Click on the Register New Application link on the OAuth Management page.
  6. Select OAuth 2.0 as the OAuth Version.
  7. Provide an Application Name and any Callback Url. For the sample to work, use http://localhost:8080/playground/oauth2client.
  8. Once you click on Add you are taken to the OAuth Management page once again.
  9. Click on the application you just created.
  10. Copy the values of Client ID, Client Secret, Access Token URL and Authorize URL -- you may need these values later during different stages in the web app.
  11. Once this is done, use the following link to navigate to the web app: http://localhost:8080/playground.
  12. In the playground, click on Import Photos.
  13. Execute the OAuth flow by selecting the Grant Type you want.



  14. Click Authorize.
  15. WSO2 Identity Server requests access to myscope. Login using your credentials.
  16. To obtain an access token, enter the value for the Access Token Endpoint and Client Secret and click Get Access Token.
  17. Click Get Photos.

You can download the complete code of sample web application from here.

From the root level type "mvn clean install" to build it.