ZenDesk iOS SDK: how to create a JWT endpoint URL?

I am working on an iOS application where I need to integrate the ZenDesk SDK. I have setup AppId, zendeskurl, clientId.

[[ZDKConfig instance] initializeWithAppId:@"xxxxxxx" zendeskUrl:@"https://xxxxx" andClientId:@"xxxxxx"]; [ZDCChat configure:^(ZDCConfig *defaults) { defaults.accountKey = @"xxxxx"; defaults.preChatDataRequirements.department = xxxx; defaults.preChatDataRequirements.message = xxxx; }]; 

When I set the authentication method as anonymous, its work stopped.

  [ZDKConfig instance].userIdentity = [[ZDKJwtIdentity alloc] initWithJwtUserIdentifier:@" xxx@gmail.com "]; 

But when I install JWT as an authentication method. He does not work.

enter image description here

+4
source share
1 answer

Kirti, I know this is a little old, but I just went through this setup and finally got her a job, hope she can help others.

Setting up the JWT endpoint as an authentication method requires that you have your own server endpoint from which Zendesk can go with authentication.

So, in the field where the JWT URL is specified, you should not have the URL for your ZenDesk instance. You should https://yourserver.com/verifyJWT (this is just an example endpoint). Then at this endpoint, your server must verify that the JWT is valid and returns either an HTTP HTTP response or an HTTP 401 response (success and unauthorized, respectively). Learn more from ZenDesk.

Then, using the iOS SDK, you need to set the identifier so that ZenDesk knows what to send to the server endpoint. The key receives an identity from your server (possibly as a response to the login), which can then be checked when ZenDesk reaches the endpoint. An identifier can be any string if it is in a format that you can verify.

You will also probably need to know how JWTs are formatted. I found this article very helpful.

+1
source

All Articles