Help me to integrate the my custom JWT generating Service into my bot

I have created my JWT generation service(API endpoint) that would serve JWT token for my iOS app to connect to the bot. But the authentication is failing and I have no clue how to go forward.

Please shed some light here.

Thanks.

@chandrahasan1 Could you please provide the below details?
Is the JWT service up and running? Are you able to generate a JWT token by passing the same request payload as it was from the SDK?
Are you seeing the issue at JWT service or the JWT grant API?
What’s the error you observe?

Thanks, @Subrahmanyam for your prompt reply.

Is the JWT service up and running?
re: JWT service is not running as of now. We have created a sample JWT token and hardcoded in the app.

Are you able to generate a JWT token by passing the same request payload as it was from the SDK?
re: Yes. We have decoded the created JWT token and verified to be the in line with that of JWT token created from Kore JWT Service.

Are you seeing the issue at JWT service or the JWT grant API?
re: Issue is with JWT grant. We need help to understand, how a JWT token provided by our server based on our own authentication would be authorized by Kore bot platform?

In the given SDK example I have seen that we are getting a JWT token from http://demo.kore.net:3000 and sending it to https://bots.kore.ai/api/1.1/oAuth/token/jwtgrant.

This is the decoded header and Payload of the JWT token I am receiving from the above mentioned Kore service.

Header:

{
  "alg": "HS256",
  "typ": "JWT"
}

Payload:

{
  "iat": 1552987262253,
  "exp": 1553073662253,
  "aud": "https://idproxy.kore.com/authorize",
  "iss": "cs-9c690539-b68f-5028-8de4-62f726400c1d",
  "sub": "chandu.hassan@medloop.co",
  "isAnonymous": false
}

By sending the following body along with the above mentioned JWT, I am getting an authorization

{
	
	"assertion": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NTI5ODcyNjIyNTMsImV4cCI6MTU1MzA3MzY2MjI1MywiYXVkIjoiaHR0cHM6Ly9pZHByb3h5LmtvcmUuY29tL2F1dGhvcml6ZSIsImlzcyI6ImNzLTljNjkwNTM5LWI2OGYtNTAyOC04ZGU0LTYyZjcyNjQwMGMxZCIsInN1YiI6ImNoYW5kdS5oYXNzYW5AbWVkbG9vcC5jbyIsImlzQW5vbnltb3VzIjpmYWxzZX0.OP_mGw9k91OIsC-RtnVGBr_gdPtTjqQ_UveT8xKCZ0Q",
	"botInfo": {
		"chatBot": "Alda",
		"taskBotId": "st-970be72e-48be-5750-8177-b6025b41839b",
		"customData": {
			"userName": "Amma",
			"sessionId": "Nanna"
		}
	}
	
}

We have achieved the step of creating the JWT token based on our authentication. We need help on configuring the auth link so that we send the authorization and user information.

What’s the error you observe?
re: We need to figure out how the Kore.ai bot is authorizing the bot