This guide will show you how to start with a new Narval Managed Cloud account and progress to a fully operational Wallet-as-a-Service environment for your organization.
How the Armory Stack works
The Armory Stack plays the core role of an Auth Service: it grant access to protected resources by enforcing the organization's access policies. If the user is authorized, the server grants a client-bound access token. The user then uses this token to access secure resources, such as a crypto wallet keys managed by the Vault.
The Armory Vault is an optional companion service used either for wallet key generation & signing, or as an integration proxy to downstream resources not natively integrated.
In production, you may choose to use another key manager or self-host the Vault
Before Getting Started
Ensure you have the following prerequisites to follow this guide effectively:
An Armory Cloud account, including a client ID and secret.
A key pair that we'll use as credential for a new user.
A local Node.js application that uses TypeScript.
Setting Secrets
To interact with the Armory Stack, you need to provide your client ID and secret. Secure these credentials as managed secrets by storing them as environment variables or directly within your application's configuration. Use the following names for your secrets:
ARMORY_CLIENT_ID
ARMORY_CLIENT_SECRET
During your Armory Cloud account setup, you were asked to generate a key pair and submit the public key for your policy and entity store. Securely store the corresponding private keys:
ARMORY_POLICY_STORE_PRIVATE_KEY
ARMORY_ENTITY_STORE_PRIVATE_KEY
You also need a key pair for the user making authorized requests. Store this user’s private key as:
ARMORY_USER_PRIVATE_KEY
Your secrets configuration file should look like this:
Initialize a new entity store with a user, associated credentials, and the created account. Entities, such as individuals, accounts, credentials, and groups, form the foundation of your organization. In the subsequent section, we will explore how these entities are regulated by policies.
The code snippet below demonstrates how to create a new account and user entity with a linked credential to it. This setup allows your SDK to make authenticated requests, confirming the identity of your application to the Auth Server through digital signatures.
Next, configure the policy store with a rule that allows admin users to perform any action. Policies consist of criteria and actions to control the operations of entities within your organization.
The key used to sign the Policy store can be the same key used to sign the Entity store.