Recent searches


No recent searches

ZCLI without auth using secure settings



Posted Apr 02, 2025

     const options = {

          url: '{{settings.rgt_gen_ai_token_uri}}',

          type: "POST",

          contentType: 'application/x-www-form-urlencoded"',

          data:  new URLSearchParams({

                  grant_type: '{{settings.rgt_grant_type}}',

                  assertion: '{{jwt}}',

                }).toString(),

          secure: true,

          jwt: genAiGenerateJWT({

            "email": '{{settings.rgt_client_email}}',

            "scope" : '{{settings.rgt_ai_scope}}',

            "token_uri" : '{{settings.rgt_token_uri}}',

            "grant_type" : '{{settings.rgt_grant_type}}',

            "private_key" : '{{settings.rgt_private_key_start}}{{settings.rgt_private_key_middle}}{{settings.rgt_private_key_end}}'

          })

     };

     client.request(options).then((response) => {

        if (response.status === 200) {

          var object = JSON.parse(response.data);

          object["configId"] = `{{settings.rgt_config_id}}`;

          return object;

        } else {

          console.error("Error getting access token:", response);

          return null;

        }

      }

      ).catch((error) => {

        console.error("Error getting access token:", error);

        return null;

      });

   

 

secure parameter value are not getting as

undefined 


 


0

1

1 comment

image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hi Kundure,
 
Sorry, I'm not sure what your question is. Can you clarify and provide a bit more context.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post