How to create Authkey for concoure server that can be used in API Calls to the concourse sever?

164 views Asked by At
 request(
        {
          url:'mysampleendpoint',
          headers: {
            Authorization: 'Auth key from Browser (skymarshal_auth)',
          },
        },
        function(error, response, body) {
          if (response.statusCode === 200) {
            resolve(response.body);
          } else {
            reject(response.statusCode);
          }
        },
      );

I am using the above code to get the job status from my concourse server. The call works fine with no issues. However, the auth_key that I have used is the one that is generated by my browser (I Copied this when I did a simple get call to the concourse server from the browser). This key is expiring every 24 hours. How can I create a permanent key that I can use in my deployed app?

1

There are 1 answers

2
Josh Zarrabi On

I don't think you can generate a permanent api key. A way to make this less painful is to write a small script that automatically pulls the token from your ~/.flyrc, which will also last for 24 hours but gets updated whenever you log into fly.