SymphonyPlatformSolutions / symphony-api-client-node

Symphony API Client for NodeJS
MIT License
6 stars 20 forks source link

The interface needs to load config file for Ext App Authentication #79

Closed Deepa1804 closed 2 years ago

Deepa1804 commented 4 years ago

https://github.com/SymphonyPlatformSolutions/symphony-api-client-node/blob/9bb4d08387d2d4d8248bce4b48d1002e0e4a24c6/lib/SymBotClient/index.js#L48

SymBotClient.authenticateExtApp = (pathToConfigFile) => { return SymConfigLoader.loadFromFile(pathToConfigFile).then(SymConfig => { SymBotClient.config = SymConfig return SymBotAuth.extAppAuthenticate(SymBotClient.config).then(symAuth => { return { appId: symAuth.appId, tokenA: symAuth.appToken } }) } }

symphony-youri commented 3 years ago

Hi @Deepa1804 I'm afraid I did not get the issue, could you provide more details please?

Deepa1804 commented 3 years ago

The issue here is, the user has to call initBot to load config. Without running initBot i cannot call SymBotClient.authenticateExtApp = () => { or SymBotClient.authenticateOboApp = () => { A call to initBot without having bot configuration in the config file fails and if I need only extension app without a BOT the call to the above function SymBotClient.authenticateExtApp fails.

Below is the modification i had to add in to get the function working SymBotClient.authenticateExtApp = (pathToConfigFile) => { return SymConfigLoader.loadFromFile(pathToConfigFile).then(SymConfig => { SymBotClient.config = SymConfig return SymBotAuth.extAppAuthenticate(SymBotClient.config).then(symAuth => { return { appId: symAuth.appId, tokenA: symAuth.appToken } }) } }

symphony-youri commented 2 years ago

Closing this as we are not actively maintaining this BDK anymore