Web Sdk Integration - Facing issue with JWT service created in my local

Hi @Subrahmanyam ,

I have created JWT service in my local following the steps provided in documentation.
My jwt service is up and running. It is also creating the token to be used for connection with Bot.
My web application is also integrated with bot. Followed steps for web sdk integration.

My sts call is successful as shown:
http://localhost:3000/api/v1/users/sts
image

But call for jwtGrant is failing as shown:
API called - https://<>/api/oAuth/token/jwtgrant
image

image

Why this api is called and how it affects bot connection.
Do you have any idea about why is this failing?

Thanks,
Neha Sheikh

@nehamsheikh This call fails when the koreAPIUrl is incorrect in the index.html file.
image

image

The jwtgrant endpoint uses the jwt token which is generated using the jwt service and sends back access token as the response.

image

Now the /rtm/start endpoint is called by using the using the access token as bearer and it returns the websocket URL using which the webSDK establishes the socket connection.

image

My koreAPIUrl is correct.

I had previously used this KoreAPIURL for some other bot on same bot builder.
sts, jwtGrant, start - all api calls worked for the other application. I was using some other jwt service for that application.

I cannot use the same jwt service for my new application as it is owned by other application.

Please suggest if I am missing anything while creating jwtService? Are there any pre-requisites for the jwtService?
Bot builder and jwt service are on two different servers. We can use them independently, right?
Does Bot builder uses/makes call to jwtService?

Thanks,
Neha Sheikh

The approach is the same on the bot builder. The /sts api is called to get the jwt, the /jwtgrant is called to fetch the access token and then /rtm/start is called to fetch the ws url and then the ws connection is established.

The difference you find is that, on the bot builder, the bearer is passed to the /sts api in the request headers as opposed to sending the client ID and client secret in the Form data while connect to web/ mobile client channel.

1 Like