This might be a simple issue but note I am brand new to VSCode and connecting, etc to a SailPoint tenant that is new to my company
VS Code - 1.86.2
sailpoint-api-client
Windows 10
Q: Where do I configure it so I can pass along the clientID/clientSecret values in my code.
NOTE: I have already setup and test a PAT for this environment that works in Postman and also in VS Code with the SailPoint IdentityNow extension. I have copied my 2 files (index.ts & part1.ts)
index.ts
import * as part1 from './part1'
const main = async () => {
const data = await part1.getAccounts()
console.log(data)
}
main()
part1.ts
import { AccountsApi, Configuration } from "sailpoint-api-client"
// List all accounts
export const getAccounts = async () => {
let apiConfig = new Configuration()
let api = new AccountsApi(apiConfig)
const val = await api.listAccounts()
return val.data
}
Running a simple project written in TypeScript and receiving an error:
PS C:\VSCode Projects\API Reporting\api-reporting-examples-main> npm start
[email protected] start
ts-node src/index.ts
Unable to fetch access token. Aborting.
C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\configuration.ts:240
throw new Error(error);
^
Error: Error: getaddrinfo ENOTFOUND {tenant}.api.identitynow.com
at Configuration. (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\configuration.ts:240:19)
at step (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\dist\configuration.js:56:23)
at Object.throw (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\dist\configuration.js:37:53)
at rejected (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\dist\configuration.js:29:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5)