Configuring the authorizationOnlyApiServlet for direct integration
The authorizationOnlyApiServlet requires two-way SSL authentication for
direct API calls. For more information, see Configuring two-way SSL authentication between WebSphere® Commerce
and Sterling Order Management.
About this task
authorizationOnlyApiServlet servlet, follow these
steps:Procedure
- Open the <INSTALL_DIR>/repository/eardata/smcfs/extn/ directory.
- If web.xml.sample does not exist, build the smcfs.ear file to generate it.
- Rename web.xml.sample as web.xml.
-
Edit web.xml to include the following code:
Note: Ensure that the id fields are unique.
where<context-param> <param-name>bypass.uri.X</param-name> <param-value>/interop/AuthorizationOnlyApiServlet</param-value> </context-param> <context-param> <param-name>request.validation.bypass.uri.yfc.X</param-name> <param-value>/interop/AuthorizationOnlyApiServlet</param-value> </context-param> <context-param> <param-name>sc.csrf.bypass.uri-X</param-name> <param-value>/interop/AuthorizationOnlyApiServlet</param-value> </context-param> <servlet id="Servlet_X"> <servlet-name>AuthorizationOnlyApiServlet</servlet-name> <servlet-class>com.yantra.interop.client.AuthorizationOnlyApiServlet </servlet-class></servlet> <servlet-mapping id="ServletMapping_X"> <servlet-name>AuthorizationOnlyApiServlet</servlet-name> <url-pattern>/interop/AuthorizationOnlyApiServlet</url-pattern> </servlet-mapping>
X is a numerical value -
Edit
<INSTALL_DIR>/repository/eardata/smcfs/extn/web.xml to
include the following:
<security-constraint> <web-resource-collection> <web-resource-name>AuthorizationOnlyApiServlet</web-resource-name> <url-pattern>/interop/AuthorizationOnlyApiServlet</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> </web-resource-collection> <auth-constraint> <role-name>WCIntegrationUser</role-name> </auth-constraint> </security-constraint> <login-config><auth-method>CLIENT-CERT</auth-method> <realm-name>defaultWIMFileBasedRealm</realm-name></login-config> <security-role> <role-name>WCIntegrationUser</role-name> </security-role>Note: To determine the value to enter for <realm-name> in web.xml, refer to the WebSphere Application Server configuration. The example in step 5 uses defaultWIMFileBasedRealm for <realm-name>. - Build the EAR, which now contains the modified web.xml file.
-
Redeploy the EAR:
- Open the WebSphere Application Server Administrative Console and click Applications > WebSphere enterprise applications.
- Select Sterling Order Management and click Update.
- Select Replace the entire application and Remote file system. Browse to the smcfs.ear file.
- Click Next and accept all defaults.
The application is updated. - In the WebSphere Application Server Administrative Console, click Security > Global Security. The Global Security settings are displayed.
- Click Security Configuration Wizard and click Enable administrative security if it is not enabled by default. Click Next.
- For Step 2: Select user repository, click Federated repositories.
- For Step 3: Configure federated repository, enter a Primary administrative user name and password. User name example: configadmin
- For Step 4: Summary, verify that the following values are shown:
Table 1. Summary of options set in the global security wizard for administrative security Options Value Enable administrative security true Enable application security true Use Java™ 2 security to restrict application access to local resources false User repository Federated depositories Primary administrative user name Varies. - Restart the WebSphere Application Server for Sterling Order Management.
- Go to Users and Groups > Manage Users > Create Users and create WCIntegrationUser.
- Go to Users and Groups > Manage Groups > Create Groups and create WCIntegrationGroup.
- Go to Applications > WebSphere Enterprise
Applications > Application_Name > Security role to user/group mapping, and map the following
below:
- WCIntegrationUser user role to the WCIntegrationUser user created in Step 14.
- WCIntegrationGroup group role to the WCIntegrationGroup group created in Step 15.
- Click Security > SSL certificate and key
management > SSL configurations > NodeDefaultSSLSettings.
- Click Quality of protection (QoP) settings.
- Set Client Authentication to Supported.
- Set Protocol to TLSv1.2.