Running the sample files on the sample server
You can work on the preconfigured sample files for OpenID Connect and run on the Liberty sample server to check your configuration.
Before you begin
You make sure that the sample server is operational, and back up the original files before you configure.
- Start the sample server. For more information about the sample server, see Using the sample server.
- Connect to the Decision Center Business console, and the Rule Execution Server console by using basic authentication. Click some features in the consoles to verify the Operational Decision Manager applications work.
- Stop the sample server.
- Back up your Liberty configuration files.
The preconfigured sample files are in the <ODM_InstallDir>/shared/oidc directory.
Tip: Put your OpenID Connect Provider URLs and credentials together in any text file so
that you can easily access the information.
Step 1: Customizing the sample files
Procedure
Step 2: Protecting the hosted transparent decision service WAR file
Procedure
- Follow the steps that are described in Configuring the hosted transparent decision service.
- Copy the protected DecisionService.war file to the <WLP_HOME>/usr/servers/<server_name>/apps directory.
Step 3: Testing the login to the Operational Decision Manager servers
Procedure
Step 4: Configuring Decision Center for deployment
Procedure
Step 5: Configuring Rule Designer
Procedure
Step 6: Invoking APIs with a bearer header
About this task
The same access token is also required for running the Ant tasks or using the Swagger user interface.
Procedure
Run the following script that uses the password flow to obtain a token:
curl -k -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" \
-d "scope=openid&grant_type=password&client_id=${client_id}&client_secret=${client_secret}&username=${username}&password=${password}" \
${token_url}
| Placeholder | Description |
|---|---|
| ${client_id} | The client ID |
| ${client_secret} | The client secret |
| ${username} | The username of the account (the resource owner) to obtain the access token |
| ${password} | The password of the account (the resource owner) to obtain the access token |
| ${token_url} | The token URL |
The access token is valid for a defined duration, generally 2 hours. The client application is responsible to renew the token by using the refresh token or another password flow.
Then, the access token is attached in the HTTP request bearer header as shown in this example:
Authorization: Bearer <access_token>