Gecko Configuration

Top  Previous  Next
Solution Installation > TradeSense Installation

Gecko Web Authentication

 

The Gecko webpage requires login credentials and can be accessed at "<tradesenseurl>/gecko/login"

 

TableCornerTopLeftC

IPT_Empty

IPT_Empty

TableCornerTopRightC

IPT_Empty

Info_icon

A logged-in session lasts for up to 30 minutes.

IPT_Empty

TableCornerBottomLeftC

IPT_Empty

IPT_Empty

TableCornerBottomRightC

 

clip0161

 

Configure Gecko Web Authentication

 

The Username and Password credentials for the Gecko login page can be changed by going to the terminal option "configure-node > Configure access to TSS" as seen below

 

gecko_01

 

Then update the "Gecko login user" and "Gecko login password"

 

gecko_02

 

TableCornerTopLeftB

IPT_Empty

IPT_Empty

TableCornerTopRightB

IPT_Empty

Important_icon

Upon changing the credentials, the Gecko container will restart to apply the changes.

IPT_Empty

TableCornerBottomLeftB

IPT_Empty

IPT_Empty

TableCornerBottomRightB

 

 

Gecko API Authentication

 

To access the Gecko API, users must authenticate using the "<tradesenseurl>/gecko/api/provisioning/v1/auth" endpoint, which generates a token upon successful authentication.

This token is used in subsequent API calls to authorize requests.

The process of obtaining the token involves sending a POST request to the "<tradesenseurl>/gecko/api/provisioning/v1/auth" endpoint with a JSON body containing a "salt" and a "authKey".

 

Authentication Process

Generate the authKey

 

To generate the authKey, which will be used for authentication, follow the below steps:

 

1.Compute the SHA-256 hash of the password.

 

SHA256<password>

 

2.Convert the result of Step 1 to uppercase.

 

UPPERCASE<SHA256<password>>

 

3.Compute the SHA-256 hash of the concatenation of the uppercase result from Step 2 and the salt.

 

SHA256<UPPERCASE<SHA256<password>>:salt>

(The result of this computation is the authKey.)

 

•In one line, the process can be described as:

authKey = SHA256<UPPERCASE<SHA256<password>> : salt>

 

"salt" can be any string of your choice.

 

Send the POST Request to Authenticate

 

Once the authKey is generated, make a POST request to the"<tradesenseurl>/gecko/api/provisioning/v1/auth" endpoint with a JSON body containing the salt and the computed authKey.

 

Sample Request:

 

POST <tradesenseurl>/gecko/api/provisioning/v1/auth

 

{

 "salt": "testing",

 "authKey": "<SHA256<UPPERCASE<SHA256<your-password>>:testing>>"

}

 

Replace <SHA256<UPPERCASE<SHA256<your-password>>:testing>> with the actual computed authKey.

 

Handle the Response

 

Once the request is sent, the gecko server will respond based on whether the authkey credentials are correct or not.

 

Successful Authentication:

 

If the credentials are valid, the server will return a JSON response containing the token.

 

Example Response:

 

{

 "token": "gfghjgfjhhgk76sdfghjsdf65h234nk34jl2345ns98no"

}

 

TableCornerTopLeftA

IPT_Empty

IPT_Empty

TableCornerTopRightA

IPT_Empty

ImportantNote_Icon

This token will be valid for one hour and must be used in subsequent API requests for authorization.

After this period, the token will no longer be valid, and clients will need to obtain a new token using the same steps provided above.

IPT_Empty

TableCornerBottomLeftA

IPT_Empty

IPT_Empty

TableCornerBottomRightA

 

Invalid Credentials:

 

If the credentials are invalid, the server will return an error message.

 

Example Error Response:

 

{

 "error": "Invalid credentials"

}

 

Accessing Gecko API

After successfully obtaining the token, it must be included in the Authorization header for any requests made to the Gecko API.

 

Authorization Header Example:

 

Authorization: Bearer <your-token>

 

Replace <your-token> with the token received in the response after successful authentication.

 

TableCornerTopLeftC

IPT_Empty

IPT_Empty

TableCornerTopRightC

IPT_Empty

Info_icon

Tip: To create a SHA256 hash, you can easily find online generators to assist with this.

IPT_Empty

TableCornerBottomLeftC

IPT_Empty

IPT_Empty

TableCornerBottomRightC

 

 

TPO and TPO Cluster api zones filter

Below are the changes made in Gecko to implement zone query parameter to filter out devices from all the available zones in tss. This will allow assure to filter out /tpo and /tpoclusters api data for all the zones including monitoring and non monitoring zones as below

 

/gecko/api/provisioning/v1/tpos?zone=all

/gecko/api/provisioning/v1/tpoclusters?zone=all

 

 

TableCornerTopLeftC

IPT_Empty

IPT_Empty

TableCornerTopRightC

IPT_Empty

Info_icon

 

Note: Without any query paramater gecko fetch tpo and tpoclusters only from the monitored zones configured in tss. To fetch devices from all the zones queryparameter(?zone=all) need to be used.

 

IPT_Empty

TableCornerBottomLeftC

IPT_Empty

IPT_Empty

TableCornerBottomRightC

 

 

Gecko WebSocket STOMP Connection

 

Only authenticated STOMP clients are allowed to establish a connection.

 

1. Client Connection Request

 

To authenticate to the STOMP server, the client must include an Authorization header in the CONNECT frame. The CONNECT frame structure is as follows:

 

1.CONNECT

2.Authorization: Bearer <TOKEN>

3.accept-version: 1.2,1.1,1.0

4.heart-beat: 10000,10000

 

Authorization: The Authorization header must include a token prefixed by Bearer

 

Token Generation: The token can be generated by calling the /gecko/api/provisioning/v1/auth API.

 

Heartbeat: The client specifies the desired heartbeat intervals for communication.

 

 

2. Server Validation

 

When the server receives the CONNECT frame, it validates the Authorization header to checks for the presence and validity of the token.

 

1.Invalid or Missing Token:

If the token is missing or invalid, the server responds with an ERROR frame and closes the connection:

 

1.ERROR message: Invalid or missing token

2.heart-beat: 10000,10000

3.Authentication failed

 

 

2.Valid Token:

If the token is valid, the server responds with a CONNECTED frame, allowing the client to proceed:

 

1.CONNECTED

2server: vertx-stomp/3.9.16

3.heart-beat: 1000,1000

4.session: de52a621-d9cc-4bba-9c11-24031f4034fe

5.version: 1.2

 

 

After successful authentication, the client can subscribe to topics to receive messages from the server. The communication between the client and gecko stomp server continues without interruption as long as:

 

•The connection remains active.

•Neither the client nor the stomp server terminates the connection.

 

Token Expiry

 

•The token generated via the /auth API is valid for 60 minutes.

•If the client attempts to connect using an expired token, the connection will be rejected by the server.

•Once connected, token expiry does not affect the active session. The client and stomp server can continue exchanging messages as long as the connection remains active.