Problem with authentication over API

Hi. i started ChirpStack in docker container and tried to connect over API.
In manual I found example only for previous version JavaScript examples - ChirpStack open-source LoRaWAN® Network Server documentation

In my code, I created a connection to the default account (admin/admin) and make connection.

import * as grpc from "@grpc/grpc-js";
import { InternalServiceClient } from "@chirpstack/chirpstack-api/api/internal_grpc_pb";
import { TenantServiceClient } from "@chirpstack/chirpstack-api/api/tenant_grpc_pb";
import { GatewayServiceClient } from "@chirpstack/chirpstack-api/api/gateway_grpc_pb";
import { ListGatewaysRequest } from "@chirpstack/chirpstack-api/api/gateway_pb";
import { LoginRequest, ProfileResponse } from "@chirpstack/chirpstack-api/api/internal_pb";

async function run() {
    const url = "";
    const login = "admin";
    const password = "admin";
    const credentials = grpc.credentials.createInsecure();
    const internalService = new InternalServiceClient(
    const loginRequest = new LoginRequest();
    const apiToken = await new Promise((resolve, rejects) => {
        internalService.login(loginRequest, (error, response) => {
            if (error) return rejects(error);
            if (response === undefined) return rejects("No value");
            const token = response.getJwt();

////const apiToken = "generate token into account"  -doesnt work

    const metadata = new grpc.Metadata();
    metadata.set("authorization", "Bearer " + apiToken);
    const gatewayService = new GatewayServiceClient(url, credentials);
    const listRequest = new ListGatewaysRequest();
    gatewayService.list(listRequest, metadata, (err, value) => {
        if (err) return console.error(err);
        if (!value) return console.error("no value");
        console.dir(value.getResultList().map((v) => v.toObject()));

But when I wanted to generate a token in my account (Network Server/API Keys) and establish a connection, I failed. What is the problem?

Hi @Umberto,
Can you share logs or error messages?

Hi @Jerome73 , in powershell i get next error

But, when i see log files in deployed docker container with chirpstack, I see this:

INFO gRPC{uri=/api.GatewayService/List}: chirpstack::api: Finished processing request status="200" latency=1.034502ms

It happens when creating an API key in the Tenant section