Create authenticated objects
When you are developing an application for a server that has authentication enabled, use the constructor that specifies
username
and
password
.
For example, in C#:
IAdministrationClient api = ClientFactory.GetAdministrationClient(serviceUrl, username, password);
Note: Even if authentication is not enabled on the server, we recommend that you use the version of the Administration client that requires user name and password so you can find the jobs executed by user names. If you supply no user name, the jobs are listed under the default username “nobody”.
When the user is successfully authenticated, the credentials become a property of the object, and the user can use the API object to invoke the required API. The server throws a
NotAuthenticatedException
exception if authentication fails.
For more information about objects using authentication credentials, see the JavaDoc or the C# CHM file, available from your server landing page, by default,
http://servername:8080/SplusServer.
For information about checking authentication using the URL API, see URL authentication.
Parent topic: Use Authentication