Can't get SDK initialization to work using JWT

I’m using the iOS SDK (with the ionic plugin modified to add jwt initialization). I find that the [authService sdkAuth] is failing if using a generated JWT, wheras using an API Key and shared secret it works ok.

The failure is that either the onMobileRTCAuth is not called at all, or onMobileRTCAuth returns with MobileRTCAuthError_Unknown.

I’ve tried generating the JWT using a number of different methods, but none work:

Directly at,
Using the .Net library System.IdentityModel.Tokens.Jwt (blessed at
Using some other methods online

Which version?

To Reproduce(If applicable)

authService.jwtToken = jwt;
[authService sdkAuth];

The JWT is generated using the known working API key and shared secret for the SDK application in the marketplace.

If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):
Varies, but the specifications don’t seem to matter. Have tried on a couple of different devices with no luck

  • Device: iPad A1893
  • OS: iOS 13.6

Additional context
Add any other context about the problem here.

Hey @gjudd

Thanks for using the dev forum!

Im sorry that is happening, that must be very frustrating.

Let’s double-check a few things:

  1. Make sure if you are using the jwtToken that you remove the "authService.clientKey = " and "authService.clientSecret = " lines.
  2. Make sure the “exp”, “iat”, and “tokenExp” values are valid. I use to get the current time, and I set exp and tokenExp to one day in the future for testing. Will verify if your dates are valid when you hover your curser overr the date.
  3. If you are using, copy the JWT string directly (dont use the share jwt string). I have also made the mistake in the past of posting the key in both the secret and key fields or vice versa.
  4. See if your jwt works in the ios sample app:

Let me know what you find!