4. RUN THE DEMO APP

6 min.

In this unit you will learn how to program an application to fetch a secret from Conjur using the REST API.

At the end of this section:
You will know how to leverage Conjur’s ability to store your application’s secrets securely.

Prerequisite

You have completed the following units:

Enter the BotApp container.

$ docker exec -it bot_app bash

Generate a Conjur token to the conjur_token file, using the BotApp API key:

curl -d "<BotApp API Key>" -k https://proxy/authn/myConjurAccount/host%2FBotApp%2FmyDemoApp/authenticate > /tmp/conjur_token

The Conjur token is stored in the conjur_token file.

Run program to fetch the secret:

$ /tmp/program.sh

The secret is displayed.

TIP: If the secret is not displayed, try generating the token again.  You have eight minutes between generating the conjur token and fetching the secret with BotApp.

Congratulations!
You are ready to secure your own apps with Conjur