skip to main content
Corticon Server: Integration & Deployment Guide : Secure servers with authentication and encryption : Implementing deployment security : Setting up authentication for secure server access : Securing Server endpoints : Using authentication in client requests
 

Try Corticon Now
Using authentication in client requests
When a request is submitted by a client to a Decision Service on a secured Corticon Server, the client must have credentials to enable connection to the server. The credentials must permit Execution operations.
You embed the username/password in the HTTP GET or an HTTP POST in the Authorization parameter in the header of the request, as follows:
1. Get the HttpPost object that is to connect to the URL on the Server:
HttpPost postRequest = new HttpPost("http://localhost:8850/corticon/execute");
2. Create an encodedString and add it to the specific Header:
// Encode the username/password in Base64. This is needed for REST calls
String username = "admin";
String password = "admin";
encodedString = Base64.encode((username + ":" + password).getBytes());

String base64EncodedCredentials = "Basic " + encodedString;

// Add the String to the appropriate Header
postRequest.setHeader("Authorization", base64EncodedCredentials);