Hitachi

JP1 Version 12 JP1/Automatic Job Management System 3 Command Reference


6.2 Authentication when using an API

To issue an API request and receive a response, authentication of the JP1 user is required every time a request is issued. The user authentication function of JP1/Base is used for the authentication method.

To receive authentication, specify X-AJS-Authorization for the request header when you issue a request, and send the JP1 user name and password. The authentication server (JP1/Base) on the manager host that received the request performs authentication of the specified JP1 user name and password. If you do not specify any JP1 user name or password, or if the specified JP1 user name or password is wrong, the status code 401 is returned, indicating that authentication is required. For details about the request header and the request format, see 6.4 Request format.

The following shows the format of the authentication information written in the request header.

X-AJS-Authorization: character-string-obtained-by-encoding-userName:password-by-using-Base64-encoding

The following table lists and describes the parameters that can be specified for the request header X-AJS-Authorization.

Table 6‒1: Parameters specified for X-AJS-Authorization

Parameter name

Description

Required?

userName

Specify the JP1 user name by using a character string.

The JP1 user to be specified here must have already been registered in the authentication server used by JP1/AJS3 - Manager on the login target.

For details about the characters that can be used for the JP1 user name, see the descriptions about the user management settings in the JP1/Base User's Guide.

Y

password

Specify the password of the JP1 user by using a character string.

For details about the characters that can be used for the password, see the descriptions about the user management settings in the JP1/Base User's Guide.

Y

Legend:

Y: Required

Example

If the user name is user and the password is password, specify the following value (which is obtained by encoding user:password by Base64 encoding):

X-AJS-Authorization: dXNlcjpwYXNzd29yZA==