1. Home
  2. Docs
  3. API Documentation
  4. Login
  5. AddLogin

AddLogin

Route: https://kayran.live/api/AddLogin

This function allow you to create new Login Authentication\Login Profiles to use in your scans.

Note : to add the desired Login to your scan, insert it’s name in as a value in the correct field when initiating a new scan.

Roles Required: Admin, Users and Private Users.

Request Syntax

{

“apiKey”: “string”,

“action”: “log_d”|”log_h”|”log_self”|”log_c”,

“loginName”: “String”,

“loginUrl”: “https://aaa.com”,

“username”: “String”,

“password”: “String”,

“headers”: [“key: value”, “key2: value2”]

“dialog”: True|False,

“params”: “[[“name”,”token”,”help”],[“id”,”Email”,”[email protected]”],[“selector”,”#Password”,”123456″],[“submit”,”body > div.auth-wrapper > div > div > div > div > div > form > button”,””]]

}


Request Parameters

Parameters being used in the Request

Parameter Name :

apiKey

Parameter Usage and Options :

Your Kayran given API Key.

How do I get it ? :

Located in the “Profile” section.

Note : by default, the “API Status” is enabled, unless, the Admin has disabled it in the “Server Settings” section.

Type :

String

Is it Optional ? :

No.


Parameter Name :

action

Parameter Usage and Options :

The type of the login profile you wish to create.

Value :

log_d – Login Dialog

log_h – Headers Authentication

log_self – Self Login

log_c – Login Credentials

Type :

String

Is it Optional ? :

No.


Parameter Name :

loginName

Parameter Usage and Options :

The name of the login profile.

Type :

String

Is it Optional ? :

No.


Parameter Name :

loginUrl

Parameter Usage and Options :

The URL of the login profile.

Type :

String

Is it Optional ? :

No.


Parameter Name :

username

Parameter Usage and Options :

A Username to be used in the login profile.

Type :

String

Is it Optional ? :

No.


Parameter Name :

password

Parameter Usage and Options :

A Password to be used in the login profile.

Type :

String

Is it Optional ? :

No.


Parameter Name :

headers

Parameter Usage and Options :

Headers that you want to be used in the login profile.

Value :

[“key: value”, “key2: value2”]

Type :

String

Is it Optional ? :

No.


Parameter Name :

dialog

Parameter Usage and Options :

In case you use the Login Dialog method (log_d).

Value :

True / False

Type :

Boolean

Is it Optional ? :

No.


Parameter Name :

params

Parameter Usage and Options :

In case you use the Login Credentials method (log_c).

Value :

Based on the user parameters (example in Request Syntax above). For more information.

Type :

String

Is it Optional ? :

No.


Successful Response

{
“Error”: 0,
“Function”: “AddLogin”,
“Data”: “Created”
}

Errors and their Possible Causes

For more information, please refer to the General Errors section.