Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Authorization in Axxon PSIM using a token key provides the following capabilitiesallows for:

  • To specify Specifying a token in the "token" parameter in a url URL request instead of specifying the "login" and "password" parameters.

    Example of a video request with authorization in Axxon PSIM using a token key:

    Code Block
    languagexml
    http://127.0.0.1:80/video/action.do?normalize=true&version=41.100.01.0224&video_in=CAM:1&token=EoHWC_zXFILImB0hL4QgjPc5624cJXMF
  • To use Using the Bearer Token Authentication in the "Authorization" parameter in the request header.

    Example:

    Code Block
    languagexml
    Authorization: Bearer PJ_eHSwUsqjXX7PRZMB8hm_zKEnCg3hE" 

Only a registered registered Axxon PSIM user can receive the token. If you don't specify the login and password for the Basic authorization in the request, the server will return returns a "500 Internal Server Error".
You can request a token via Web server and Web server 2.0.
When you send a request to get a token via Web server 2.0, cookies are saved. If you send an authorization request without a token but with cookies already saved, the process will be successful. After you restart the server with a still valid token, the request also goes through.

Example of a request to get a token via Web server 2.0:

Code Block
languagexml
http://1:1@127.0.0.1:8085/web2/secure/token?expires_in=300

Example of a request with a token for authorization via Web server 2.0:

Code Block
languagexml
http://127.0.0.1:8085/web2/secure/persons?token=

Example of an authorization request via Web server 2.0 without a token and with cookies saved:

Code Block
languagexml
http://127.0.0.1:8085/web2/secure/persons?

General format of request:

GET/POST http://{login}:{password}@IP - address:port/token?expires_in={expires_in}

Request parameters:

Parameter

Required

Description

login YesUser login in Axxon PSIM
passwordYesUser password in Axxon PSIM
expires_inNo

Token validity time in seconds. The maximum value is 1 day. The token expires after a specified period of time.

The default value is 1800.

To log out, specify the 0 value 0.

Note. There can be only 1 token for each user

Request example:

GET/POST http://USER:PASSWORD@127.0.0.1:80/token?expires_in=1800

Response example:

Code Block
languagexml
{
"access_token":"PJ_eHSwUsqjXX7PRZMB8hm_zKEnCg3hE",
"token_type":"bearer",
"expires_in":"1800"
}

Response parameters:

Parameter

Description

access_tokenToken
token_type

Token type

expires_inToken validity time in seconds

...