Implement digest authentication in unsupported tools
Digest authentication with IBM Integration Bus and IBM App Connect
Digest authentication is a common authentication method that enables web servers to authenticate a user to his or her web browser. In this code pattern, I show you how to implement digest authentication in development tools that don’t include this authentication natively. IBM Integration Bus is one such tool, so I will use it as an example. After walking through the steps of this pattern, you will be able to apply similar logic to any development tools you are using that don’t have built-in digest authentication.
In this code pattern, learn how to build a service in IBM Integration Bus which can be exposed as a proxy to achieve digest authentication. We cover how digest authentication mechanism works in background and what logic needs to be built for a platform which doesn’t support digest authentication of its own. We will also learn how to expose the IBM Integration Bus service on an IBM Cloud Kubernetes cluster and consume it via a sample client. The sample application and client application is built on IBM Integration Bus and deployed on a Kubernetes node using a Docker image.
After completing the code pattern, you will understand how to:
- Create a message flow and build logic for digest authentication
- Deploy and test your application locally
- Expose the IBM Integration Bus digest authentication service to Kubernetes
- User sends a request to the IBM Integration Bus application on the cloud.
- Application sends the request to the server seeking authorization.
- The request is rejected by the server asking for authorization. The server responds with the details to create authorization.
- Application builds authorization logic.
- Application sends another request to the server seeking authorization.
- The request is successfully authorized.
- The application saves the authorization header or cookies in a cache for the next http request and responds with success.
- User sends next request to IBM Integration Bus application on the cloud.
- Application synchronizes the request and cache before seeking server authorization.
- Request sent to server, server authorizes user, and a “success” response is sent back to the user.
Follow the detailed steps in the ReadMe to complete the pattern. Here is an overview of the steps you’ll take:
- Create a digest authentication service.
- Deploy the service locally and test it.
- Create the cluster and deploy it on IBM Cloud.
- Test a sample API on IBM App Connect on IBM Cloud.