Evaluate HTTP Basic Authentication Action
1. INTRODUCTION
2. PRE-REQUISITE
3. Summary
4. CONFIGURATIONS
4.1. Create a Consumer Application with Identification token
4.2. Create a virtual alias with Evaluate HTTP basic authentication action
4.3. Configure Evaluate HTTP basic authentication policy in CentraSite
5. DEPLOY AND VALIDATE THE DEPLOYMENT
6. EXECUTION AND VERIFICATION OF VIRTUAL SERVICE RUNTIME INVOCATION
7. TROUBLESHOOTING WITH EVALUATE HTTP BASIC AUTHENTICATION ACTION
1. INTRODUCTION
This tutorial will explain the configuration and usage of the runtime action "Evaluate HTTP Basic Authentication Action" using CentraSite and webMethods Mediator.
The Evaluate HTTP Basic Authentication runtime policy enforcement will help in the following
- Identify the consumer application HTTP Basic Authentication making the request for the virtual service if identify attribute is turned ON
- Validate against a set of global or pre-registered consumer applications with the HTTP Basic Authentication in wM Mediator
2. PRE-REQUISITE
- Knowledge in basics of wM Mediator runtime, CentraSite and HTTP basic authentication (BA).
- wM Mediator target should be created in CentraSite
- CentraSite configuration should be done in wM Mediator to verify the result
3. Summary
Steps involved when using of Evaluate HTTP Basic Authentication (BA) action in CentraSite and wM Mediator
- Create a Consumer Application (eg. MyBasicAuthConsumers) with one or more Identification token(s) and deploy it to wM Mediator.
- Create a virtual alias(eg. VS_EchoWS_BasicAuth) in BusinessUI.
- Configure virtual alias with Evaluate HTTP Basic Authentication action for policy enforcement.
- Deploy the virtual alias(eg. VS_EchoWS_BasicAuth) to wM Mediator.
- Invoke the virtual service deployed in wM Mediator using SOAP Client (eg. SOAPUI).
4. CONFIGURATIONS
4.1. Create a Consumer Application with Identification token
- Login to CentraSite Control UI and Create an asset type of "Application".
Choose "Identification token" as identifier and set the attribute value(s) to the token Eg. "Administrator", "DeveloperJava", "...".
- Navigate to Operations -> Deployment and invoke "Deploy Consumers" tab in CentraSite. Select target(s).
- Invoke "Syncronize" to deploy the Consumer Application to wM Mediator
- Confirm the status as success
User can now enforce the restriction of allowing only these consumer applications or identifying the calling applications for virtual services in wM Mediator using the Evaluate HTTP Basic Authentication policy.
<<IMage -
Verify deployed consumer application (eg. MyBasicAuthConsumers) with expected attribute in wM Mediator.
-
Open wM Mediator page, http://<hostname>:5555/WmMediator and click on "Consumers" link.
-
Look for the deployed Consumer Application listed as in the sample screen below
4.2. Create a virtual alias with Evaluate HTTP basic authentication action
Perform the following steps to create a virtual alias with evaluate HTTP Basic Authentication Policy
- Login to BusinessUI
- Open a service details page of the service that needs to be virtualized.
- Click on "Virtualize" action to get virtualization wizard screen. Provide alias name (eg.VS_EchoWS_BasicAuth) in "Create a New Virtual Alias" input box
- Select an endpoint from the list of "Endpoints of <service name> to Virtualize" and click "Next".
4.3. Configure Evaluate HTTP basic authentication policy in CentraSite
- Navigate to "Policy Enforcement" heading -> "Security" -> drag & drop "Evaluate HTTP Basic Authentication" action into "Enforce" message flow.
- Click on the configure icon, the icon will appears on mouse over of "Evaluate HTTP Basic Authentication" text in message flow.
Select one of the following option to identify the consumer(s)
- "Global Consumers" (relax) - wM Mediator will try to verify the token (sec.4.1.6) against a list of all global consumers available in the Mediator.
- "Registered Consumers" (strict)- wM Mediator will try to verify the token (sec.4.1.6) against the list of consumer applications which are registered as consumers for this specific API.
-
"Do not identify" (donotidentify) - wM Mediator will not identify consumer(s). Anonymous access is allowed for this specific API.
-
Authenticate User - If this option is selected then wM Mediator will identify and authenticate the user begin carried using HTTP basic authentication header
Optional Step: Apply Log Invocation Policy to the virtual service and select CentraSite to send the log data.
This step is required only to generate and validate the events.
- Click "Virtualize" to complete the virtualization of the service.
5. DEPLOY AND VALIDATE THE DEPLOYMENT
Deploy the virtual alias (Eg. VS_EchoWS_BasicAuth) to wM Mediator target(s) by clicking "Publish..." option from BusinessUI.
- Verify deployed service(s) in wM Mediator page
- Invoke http://<mediator_host>:5555/WmMediator from a web browser and provide credentials to access the page
Click "Services" link to get list of mediated service(s) in the wM Mediator and find the virtual service (eg.VS_EchoWS_BasicAuth).
- Verify virtual service definition for the policy in wM Mediator
- In the above page, click on the [VSD] link for the virtual service to see the virtual service definition (VSD).
-
It should be able to find the following entries in the VSD as seen in the below snippet when Global Consumers (relax) and "Authenticate User" (validate="true") is selected.
-
If Registered Consumers selected as identify (strict) method then the enforcement action element should have identify attribute set to strict. This is to identify the consumer from the register consumers list.
- If Do not identify selected as identify (donotidentify) method then the enforcement action element should have identify attribute set to donotidentify.
6. EXECUTION AND VERIFICATION OF VIRTUAL SERVICE RUNTIME INVOCATION
- Get the WSDL by clicking on [WSDL] to invoke the virtual service as stated in step 5.2.b
-
Execute the virtual service (eg.VS_EchoWS_BasicAuth) from a SOAP Client with the specific user in HTTP Header of Authorization header as below
-
The sample virtual service request looks like
-
Successful consumer identification for the HTTP Basic Authentication user (eg. Administrator) begin passed in the HTTP Header
Failure consumer identification with the policy violation event
7. TROUBLESHOOTING WITH EVALUATE HTTP BASIC AUTHENTICATION ACTION
S.No.
|
Exception
|
Description
|
Possible cause/ Solution
|
---|---|---|---|
1 |
Mediator encountered an error:Consumer could not be identified. com.softwareag.pg.exceptions.PolicyViolationException |
Consumer could not be identified. Anonymous access is not allowed for this service! |
The user not identified as specified in the HTTP Header.
|
2 | Mediator encountered an error:Authentication failed for user XXXXX com.softwareag.pg.exceptions.PolicyViolationException |
Authentication failed |
Click here to download PDF version of this tutorial.