JWT not found 404 error in web/mobile client integration with bot

channel
chatbots

(Priyanshu Shukla) #1

I have integrated a bot with webapp in 2 scenarios.

Case 1:
Platform: bots.kore.ai
Bot Name: ServiceNow Bot
JWT: Found JWT & it is working fine

Case 2:
Platform: xx-bots.kore.ai (purchased kore.ai platform)
Bot name: ServiceNow Bot (same bot used in case 1)
JWT: not found…giving 404 error

Kore-config.js file code

(function(KoreSDK){
var KoreSDK=KoreSDK||{};
var botOptions = {};
botOptions.logLevel = 'debug';
botOptions.koreAPIUrl = "https://bots.kore.ai/api/";
botOptions.koreSpeechAPIUrl = "";//deprecated
//botOptions.bearer = "bearer xyz-------------------";
//botOptions.ttsSocketUrl = '';//deprecated
botOptions.koreAnonymousFn = koreAnonymousFn;
botOptions.recorderWorkerPath = '../libs/recorderWorker.js';

//botOptions.JWTUrl = "http://demo.kore.net/users/sts";
botOptions.JWTUrl = "http://localhost:3000/api/users/sts";

For Case 1, i have used the below code.

//bot 1 service now integration using bots.kore.ai platform
botOptions.userIdentity = 'priyanshu.shukla@xxx.com';// Provide users email id here
botOptions.botInfo = { name: "ServiceNowBot", "_id": "st-xxxxxxxxxxxxxxxxxxxx" }; // bot name is case sensitive
botOptions.clientId = "cs-363fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
botOptions.clientSecret = "v4d+2tOxxxxxxxxxxxxxxxxxxxxxxxxxxxx=";

For case 2, i have used below code:
//Bot 2: ServiceNow Bot integration with xx-bots.kore.ai platform
botOptions.userIdentity = ‘priyanshu.shukla@xxx.com’;// Provide users email id here
botOptions.botInfo = { name: “ServiceNow Bot”, “_id”: “st-4a4xxxxxxxxxxxxxxxxxxxx” }; // bot name is case sensitive
botOptions.clientId = “cs-d58a7dd0-xxxxx-5xxxxxxxxxxxxxxxxxxxxxxxxx”;
botOptions.clientSecret = “N/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=”;

Do i need some other configuration to connect my enterprise kore platform bot with webapp?
Please help asap.
Thanks in advance!


(Subrahmanyam Donepudi) #2

@priyanshuwwg I am thinking you are using an on premise instance. Are you using the same JWT service at both the instances? If Yes, you should check if the JWT service can be accessible from your instance.

Also, I’d recommend you to host and maintain the JWT service by your self at the enterprise.


(Priyanshu Shukla) #3

yes i am using an on premise instance.
I solved that issue now.
I was using the default url as https://bots.kore.ai/ but i need to change it. as:

In kore-config.js
botOptions.koreAPIUrl = “https://xx-bots.kore.ai/api/”;

In kore-widgets-config.js
botOptionsWiz.koreAPIUrl = “https://xx-bots.kore.ai”;

Thanks @Subrahmanyam for your response.