I want to use node JS express as my back server to get data from cognite refer to their
https://developer.cognite.com/sdks/js/
for the backend:
import { ConfidentialClientApplication } from "@azure/msal-node";
import { CogniteClient } from "@cognite/sdk";
async function quickstart() {
const pca = new ConfidentialClientApplication({
auth: {
clientId: 'YOUR CLIENT ID',
clientSecret: 'YOUR CLIENT SECRET',
authority: 'INSERT AUTHORITY HERE'
}
});
async function getToken() {
var response = await pca.acquireTokenByClientCredential({
scopes: ['INSERT SCOPE HERE'],
skipCache: true,
});
return response.accessToken;
}
const client = new CogniteClient({
appId: 'Cognite SDK samples',
baseUrl: 'YOUR BASE URL',
project: 'YOUR CDF PROJECT NAME',
getToken: getToken
});
const assets = await client.assets.list();
console.log(assets);
}
quickstart();
What is the authority and how can I find my authority?