White Papers
Abstract
Part 7 of this multi-part article series describes how to use a WebSphere DataPower service to act as an OAuth token enforcement point for an IBM Tivoli Federated Identity Manager OAuth authorization server.
Content
At the last step of the OAuth protocol pattern, the OAuth client requests access to the desired resource directly from the server hosting that resource. The entire OAuth protocol exists to support this request, providing a secure method for clients to gain access to resources owned by someone else. For example, John wants to use some of Fred's photos for a project. John uses his graphics application (the OAuth client) to get access to Fred's photos (the resource server) that uses permission (in the form of an OAuth access token) granted by Fred (the resource owner). John's client application obtains the access token from a Tivoli Federated Identity Manager authorization server. The resource server verifies the OAuth access token before returning the photos requested by the client. However, this consumes server resources and requires configuration maintenance. The access verification can be done in the DMZ, but it is not secure to put the resource server in the DMZ. By placing a DataPower appliance in front of the resource server, all token handling and verification are done by the appliance rather than the server. This way, the DataPower device is positioned in the DMZ and becomes the OAuth resource server enforcement point. When DataPower acts as an enforcement point for the resource server, it verifies the access token. DataPower only allows the request to the backend resource server if the access token is valid. To verify the token, the DataPower device contacts the Federated Identity Management server directly. The supported version of Federated Identity Management is V6.2.2 or later. This article presents steps to configure the DataPower device as the enforcement point. In order to reproduce this configuration in your own environment, you need to have an instance of the Federated Identity Management server running and accessible on your network. Before configuring the DataPower device, it is necessary to set up and configure the Federated Identity Management server. The complete set of steps for accomplishing this task is beyond the scope of this article. Figure 2 shows some of the key values held in Federated Identity Management. Note the values entered for Client Identifier and Client Shared Secret, shown at the bottom of the image in Figure 2. These values are used to identify the DataPower device when it contacts the Federated Identity Management server. All remaining procedures take place on the DataPower device. In order to shorten and simplify the procedures shown in this article, the configuration and artifacts needed to create an SSL Proxy Profile must first be imported into the DataPower device you are using for these steps. The zip files containing the information you need are provided with this article. Download both files and extract the two crypto key files from the OAuth-TFIM-SSLProfile-crypto.zip file. At this point, you need to upload a stylesheet to the device: The procedures are now complete. This object in the DataPower configuration represents the configuration on how to contact the remote Federated Identity Management server. These values allow the device to successfully connect to the Federated Identity Management server. The resulting object is used in the configuration of an AAA policy. Substituting the IP address provided for the TFIM server in for The Username and Password fields are used as basic authentication credentials for the appliance when connecting to the Federated Identity Management validation endpoint. This user is configured on the Federated Identity Management server with permissions to submit WS-Trust requests. DataPower uses an AAA policy to authenticate the OAuth client making a request for the resource, and also to verify the access token presented by the client. In this case, you use an XML Firewall service to accept inbound resource requests, validate the access token, and allow or disallow access to the resource requested. A Multi-Protocol Gateway can also be used. Now you create the processing policy for the service. The request rule resembles the illustration shown in Figure 16. In the following example, there is a web-based OAuth client listening on port 3000 that performs the OAuth token request handshake with the Federated Identity Management server. The response is a valid access token that can be used to request the resource from the resource server, which is now protected by the DataPower device. In this case, the request URI is used as the scope. This returns an This sends the access token to the token enforcement point you created as a bearer token in the Authorization header. You should receive a response similar to the following: This article showed how to use DataPower as the resource server enforcement point in an OAuth protocol exchange, as well as demonstrated a configuration example implementing this role. The OAuth protocol specification covers many other scenarios. This series of articles on DataPower implementation of the OAuth protocol provides more details on how DataPower can act in other capacities in an OAuth exchange. The authors would like to thank Shiu-Fun Poon for her review of this article.Introduction

Register the OAuth client in Federated Identity Management




cert in the navigation pane Search box and click Crypto Certificate. A list of certificate objects appears.
SSL in the Search box. Click SSL Proxy Profile. A list of SSL Proxy Profile objects appears. Two profiles marked "new" appear in the Up state as shown in Figure 7. 
Create a Federated Identity Management endpoint
IBM Tivoli Federated Identity Manager into the search bar and click Add to create a new Federated Identity Management endpoint object.<TFIM_IP> and the TFIM Federation name in for <TFIM_Federation>.
Create an AAA policy
AAA Policy in the search bar and click Add to create a new AAA policy object.



60 seconds as shown in Figure 12. This configures the AAA policy to cache Federated Identity Management OAuth authorization results for up to 60 seconds. The effective Time To Live (TTL) is less if the Federated Identity Management server indicates that the access token expires sooner. Select TFIM Authorization endpoint as the OAuth Endpoint Type.
Create an XML Firewall
Advanced in the navigation search and click New Advanced Firewall.tfim-oauth-ep in the Name field as shown in Figure 14.8888.
Create the processing policy
tfim-oauth-ep in the Name field as shown in Figure 15.




Send request
curl -k https://oauthclient:3000/getUserInfo/uid/12345678
<access_token> node similar to the following: <access_token>FIsqmCZ5yp1GFYh6iYm7</access_token>
curl -k https://<DataPower_IP>:<ResourceServer_Port>/getUserInfo/ uid/12345678 -H "Authorization: Bearer <AccessToken>" –d "my-name=<name>&my-job=<title>"
<DataPower_IP>, the port you used for the XML Firewall for <ResourceServer_Port>, the access_token extracted from the last command for <AccessToken>, your name for <name>, and your job title for <title>. <?xml version="1.0" encoding="UTF-8"?> <request><url>/getUserInfo/uid/12345678</url><base-url>/ getUserInfo/uid/12345678</base-url><args src="url"/><args src="body"><arg name="name">Dave</arg><arg name="title">Engineer</arg></args></request>


stsuuser:Attribute nodes with type="urn:ibm:names:ITFIM:oauth:response:attribute". 
stsuuser:Attribute nodes in the WS-Trust response. These are set for consumption by the backend, and can be disabled by setting Export Response Attributes to "off" in the AAA policy. These values are also available as input to the AAA PostProcessing's custom XSLT method. 
Conclusion
Acknowledgments
Was this topic helpful?
Document Information
Modified date:
08 June 2021
UID
ibm11109487