2.2 How do I Authenticate?

To gain access to Oracle VM Manager, a client must first authenticate successfully. Oracle VM Manager supports the HTTP Basic Authorization mode for REST. The username and password must be sent as part of the header of the initial request in order for Oracle VM Manager to authenticate the request. In subsequent requests, the session cookies, attached to the initial response, should be sent instead of continuing to send the username and password with each new request.

Note

The login method in the OvmWsRestClient class provides an example of how to set the username and password in the request header.

Examples of the login process as required by REST are also provided in the example code included in this document. See Section 2.6.1, “Authenticating” for further examples.

The REST API also has support for certificate-based authentication. As long as you have a valid certificate that is signed and registered either with the internal Oracle VM Manager CA certificate, or with a third-party CA for which your have imported the CA certificate into the Oracle VM Manager truststore, you can authenticate easily using your certificate instead of including a username and password facility within your code. Signing and registering certificates against the internal Oracle VM Manager CA certificate can either be achieved using the provided certificate management tool, discussed in Setting up SSL on Oracle VM Manager in the Oracle VM Administrator's Guide; or can be achieved programmatically using the Oracle VM Manager Utilities REST API discussed in Chapter 4, Additional Utilities Exposed in the WS-API.