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

AddLogin

Route: https://api.kayran.live/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”: “String”,

“loginName”: “String”,

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

“username”: “String”,

“password”: “String”,

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

“params”: “String[List]”,

“otpPhoneNumber”: True/False,

“otpEmail”: True/False,

“otpReg”: True/False,

“logout”: True/False,

“verifyLoginStatus”: True/False,

“verifyLoginUrl”: True/False,

“verifyLoginPage”: True/False,

“verifyLoginStr”: True/False,

“loginAutoAfter”: True/False,

}


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 :

params

Parameter Usage and Options :

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

Value :

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

For more information.

Type :

String

Is it Optional ? :

No.


Parameter Name :

otpPhoneNumber

Parameter Usage and Options :

In case you want to use a phone number to make a login with OTP (One time password).

Value :

“+972XXXXXXXXX”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

otpEmail

Parameter Usage and Options :

In case you want to use email as OTP (One time password).

Value :

“email@your-domain”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

otpReg

Parameter Usage and Options :

Detect 2 factor authentication based on a regex pattern

Value :

“Regex_pattern_name”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

logout

Parameter Usage and Options :

In case there’s a logout location on the pages or a logout page, specify and Kayran will ignore it.

Value :

“Log-out OR logout, Logoff, Log-Out, logout.php”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

verifyLoginStatus

Parameter Usage and Options :

Check for specific status in the response.

Value :

“1-999”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

verifyLoginUrl

Parameter Usage and Options :

Login page to verify the user is logged in.

Value :

“https://example.com”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

verifyLoginPage

Parameter Usage and Options :

Final url incase of redirection, make sure user is logged in.

Value :

“https://example.com”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

verifyLoginStr

Parameter Usage and Options :

String to look for in the login page for confirmation.

Value :

“Logged in”

Type :

String

Is it Optional ? :

Yes.


Parameter Name :

loginAutoAfter

Parameter Usage and Options :

Login incase the system automatically logs you out after certain time.

Value :

“1-10 hours”

Type :

String

Is it Optional ? :

Yes.


Successful Response

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

Errors and their Possible Causes

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