WeatherKit · Apple Developer · iOS

Failed to generate jwt token for: com.apple.weatherkit.authservice

Apple WeatherKit may fail even when your Swift code is correct. The problem is often not the weather request itself, but WeatherKit authorization.

The typical error looks like this:

Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error
Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

The real cause you might miss

Many developers correctly enable WeatherKit in Xcode and still get this error.

The reason is that WeatherKit must be enabled not only in the app capabilities configuration, but also separately in the Apple Developer portal under App Services.

This second switch is essential and easy to miss because Apple exposes WeatherKit configuration in multiple places.

Correct WeatherKit setup path

  1. Open https://developer.apple.com/account
  2. Click Identifiers.

Apple Developer Identifiers page for enabling WeatherKit

  1. Select your App ID.
  2. Ensure WeatherKit is enabled under Capabilities.
  3. Ensure WeatherKit is also enabled under App Services. This is the important part many developers miss.

Apple Developer App Services WeatherKit configuration

If WeatherKit is enabled only in Capabilities but not in App Services, iOS may fail while generating the JWT token required for WeatherKit authentication.

After changing these settings

The following may also be necessary:

  1. Regenerate or refresh provisioning profiles.
  2. Clean the Xcode build folder.
  3. Delete the app from the device.
  4. Build and install again.

What not to debug first

Do not start by rewriting your WeatherKit request code, changing coordinates, debugging JSON parsing, or replacing async calls.

If the error says that the JWT token cannot be generated, first check Apple Developer configuration, App Services, Capabilities, signing, and provisioning profiles.

Short answer

The error Failed to generate jwt token for: com.apple.weatherkit.authservice usually means that WeatherKit is not fully enabled for the app.

Enable WeatherKit both in Capabilities and in App Services for the correct App ID, then rebuild the app with a fresh provisioning profile.