Creating identities
Identities in JLINC are how users or entities in your system are associated with cryptographic keys and authenticated for transactions. JLINC is flexible in its use of these identities and their associated keys. These keys are used to sign transactions and to validate audit records.
Each identity includes a short name, which uses the standard federation format of name@domain.tld, similar to an email addresses. To get a list of valid domains configured for your JLINC Server:
const domains = (await axios.post(
`https://api-test.jlinc.io/api/v1/data/entity/domains/get`,
{
fedidUrl: config.fedidUrl, // optional, the server default will be used if omitted
},
{
headers: {
'Authorization': `Bearer ${token}`,
}
}
)).data;
console.log(`Available domains: ${JSON.stringify(domains, null, 4)}\n`);
Once you have these domains, you can begin creating entities as required:
const system = (await axios.post(
`https://api-test.jlinc.io/api/v1/data/entity/create`,
{
fedidUrl: config.fedidUrl, // optional, the server default will be used if omitted
shortName: `system@${domains[0]}`,
},
{
headers: {
'Authorization': `Bearer ${token}`,
}
}
)).data;
console.log(`System entity: ${JSON.stringify(system, null, 4)}\n`);