Login procedure

Login is required to assign a specific user to the current session. Many requests cannot be processed without this step. The same can be said on the operations with projects, datasets, columns, etc.

Login can be performed via LDAP Server, which must be configured in the Administrative Tool beforehand.

No need to use an access token when logging in. Otherwise, the 500 error code (username not specified) will be returned.

Successful login will consume one user license which will be freed when the session is over due timeout or a logout request. For more information see here.

Login to the PolyAnalyst 6.x server

Log in to the PolyAnalyst 6.x server with your user name and password:

URL

/login

Method

POST

Response type

sync

Query parameters

Name Type Required Description

uname

string

yes

User name.

pwd

string

no

Password.

useLDAP

number (0 or 1)

no

If set to 1, perform login via LDAP Server.

svr

string

no

LDAP Server address.

Request body example (application/json)

<empty>

Request URLs

Login by using name and password:

https://your.polyanalyst.server:port/polyanalyst/api/v1.0/login?uname=user&pwd=password

Login via LDAP server:

https://your.polyanalyst.server:port/polyanalyst/api/v1.0/login?uname=user&pwd=password&useLDAP=1&svr=ldap.polyanalyst.com

Response body example (application/json)

{
  "result": "success"
}

where

Name Type Description

result

string

Result of the operation.

The server will return code 200 if login is successful with a message in the result field. Since this moment the current session will be authorized. All further requests in this session will have the same access rights as an impersonated user.

If an error has occurred, the server can return code 400 or 500 with more detailed information.

Response examples

Code Response body and description

200

Login is successful.

{
  "result": "success"
}

500

Login failed (user name not specified).

{
  "error": {
    "code": 500,
    "title": "",
    "message": "Login failed - user name not specified"
    }
}

500

Login failed (invalid user name).

{
  "error": {
    "code": 500,
    "title": "",
    "message": "User administrattor not found"
    }
}

500

Login failed (invalid password).

{
  "error": {
    "code": 500,
    "title": "",
    "message": "Login failed - password mismatch"
    }
}

500

Database in recovery. Try later.

{
  "error": {
    "code": 500,
    "title": "",
    "message": "PolyAnalyst Server performs database recovery and cannot establish connection right now. Please wait a minute and retry operation"
    }
}

500

Default LDAP server error.

{
  "error": {
    "code": 500,
    "title": "",
    "message": "Detecting default LDAP server error"
    }
}

500

Null passwords are not supported for LDAP.

{
  "error": {
    "code": 500,
    "title": "",
    "message": "Empty passwords are not supported for LDAP"
    }
}

500

The LDAP server address is not authenticated by the PolyAnalyst server.

{
  "error": {
    "code": 500,
    "title": "",
    "message": "LDAP server 192.168.123.32 is not authenticated by PolyAnalyst server!"
  }
}