How to login to openHAB through node js application

Hi,
I am currently using openhab 3 and with the help of openhab ui and zigbee bindings, i’m able to add, control and delete the zigbee devices and even REST APIs works well.
I’m using
HARDWARE: raspberry pi board
OS: linux os
visual studio for node js application

instead of login and controlling through openhab UI, i wanted to login it through node js code. Is there any procedure and code flow or APIs related documentation through which i can be able to login to openhab UI through node js application
can i know how the following FORM DATA is generated that i have observed through inspect in web browser while login to openhab

client_id:http://192.168.0.21:8080
redirect_uri:http://192.168.0.21:8080
code:3e8a555d7c52425a8ebfd3d230b4850e
code_verifier:6o1xk3RF58NQFJuRu1d2Ru5pBU72GnLfg0YkjLGNyOZ

You likely should use the token based authentication for the API. Another option would be to enable basic authentication & use that,

Both options are documented in the official documentation. This forum is not a substitute for reading the fine documentation.

Yes, actually I am doing exactly this. I am using basic authentication to log in, not the token. In order to do so, you need to activate this option in the UI.
However I have to admit that I am just a beginner with node js so there may be probably better coding solutions than that. On node js side I am using the request package to call the OH Rest API.
Here are a few code snippets which work for me in my local LAN, the example shows the basic authentication and reads the list with all things from OH:

var ohserverip = 'http://192.168.1.20:8080'; 
var ohusername = 'username'; 
var ohpassword = 'password';
var ohauth = "Basic " + new Buffer((ohusername) + ":" + (ohpassword)).toString("base64");

var options = {
        url: ohserverip  + '/rest/things',
        method: 'GET',
        headers: {
            'Accept': 'application/json',
            'Accept-Charset': 'utf-8',
            'User-Agent': 'just a client',
            "Authorization" : ohauth
        }
    };

request(options, function(err, resp, body)  {
         json = JSON.parse(body);
		 
		 for(var i=0; i<json.length; i++) 
		 {
		 //do anything you want with the thing data
		 }
		 }
		 

I hope that it helps you to get along!