OAuth sample

The OAuth samples demonstrate OAuth 2.0 client, client registration, and client revocation. The samples show the basic implementation of JavaServer Pages (JSP) to write an OAuth client, an OAuth client registering servlet, and an OAuth client revocation servlet.

Prerequisites for use

  • WebSphere® Application Server Version 8.5.0.1, Version 8.0.0.5
Important: These samples were tested with WebSphere Application Server Version 8.5.0.1

Sample download

To use the sample, download OAuth files from a product download site:

  1. Choose one of the following methods to download the oauth.zip file to a directory on your workstation: FTP or HTTP. You might create the /samples/oauth directory path on your workstation and download OAuth sample files to that directory path.
  2. From the displayed dialog, specify the target directory to which to save the compressed file and click OK.
    The oauth.zip file contains sample files in the following directory structure:
    /images
    /installableApps
    /META-INF
    /scripts
    /src
    /style
    build.xml
    readme.html
    Attention: The readme.html file contains information for installing and running the sample.

Sample description

ClientMgmt.jsp
The ClientMgmt.jsp sample queries authorization given by a user, and the user can delete permission given to a client.
Clienttable.jsp
Use the Clienttable.jsp sample as a sample management page to interface with the client provider object that is supplied to the OAuth provider component. The management page is tailored to interact with the default in-memory client provider sample, com.ibm.ws.security.oauth20.plugins.BaseClientProvider. Use custom management tools for other client repositories, like a database, or modify this page, as needed. This JSP sample adds a registered client to an XML based client store. The Oauth service provider uses the client store XML file as a gatekeeper to decide if a client can make OAuth request to the service.
Dbclienttable.jsp
This JSP sample saves a registered oauth client to oauth database table. Use this as a sample management page to interface with the client provider object supplied to the OAuth provider component. This page is tailored to interact with the default database client provider sample, com.ibm.ws.security.oauth20.plugins.db.CachedDBClientProvider. Use custom management tools for other client repositories, such as a database, or modify this page, as needed.
Concept topic    

Terms and conditions for product documentation | Feedback

Last updated: January 29, 2018 04:57 AM GMT-06:00
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd-mp&topic=sample_oauth
File name: sample_oauth.html