Web-Service Authentication

Silk Central data is protected against unauthorized access. Login credentials must be provided before data access is granted. This is true not only when working with the HTML front-end, but also for communication with Silk Central through SOAP or REST API calls.

The first step in querying data, or applying configuration changes for Silk Central, is authentication. When authentication is successful, a user session is created that allows execution of subsequent operations in the context of that user login.

When accessing Silk Central through a web browser, session information is not visible to the user. The browser handles session information with the use of cookies. In contrast to using Silk Central through HTML, SOAP calls must handle the session information manually.

Micro Focus recommends authentication through a web-service token. You can generate such a web-service token in the User Settings page of the Silk Central UI. To access this page, hover the mouse cursor over the user name in the Silk Central menu and select User Settings.

You can also use the logonUser SOAP call or the login REST API call for authentication. The method call returns a session identifier that references the session created on the server and at the same time is used as a key to access Silk Central in the context of that session.

Each subsequent API call that requires authentication takes such a web-service token or session identifier as one of its parameters, checks its validity, and executes in the context of the corresponding session.

A Silk Central session created through web services can not be ended explicitly. Instead, sessions end automatically when they are not used for a period of time. As soon as a session times out on a server, the subsequent SOAP calls that attempt to use the session throw exceptions.

A demonstration client is available for download in Silk Central at Help > Tools > Web Services Demo Client. This demo project utilizes the Silk Central tests web service, helping you to get familiar with the web service interface.

Examples

If you have generated a web-service token in Silk Central UI, the following Java code sample demonstrates access to Silk Central through web services and the use of the web-service token:
string webServiceToken = "e39a0b5b-45db-42db-84b2-b85028d954d5";
Project[] projects = sccentities.getProjects(webServiceToken);
The following Java code sample demonstrates the same access to Silk Central through web services and the use of the session identifier:
long sessionID = systemService.logonUser("admin", "admin");
Project[] projects = sccentities.getProjects(sessionID);