JWT Token Errors

I have an app using weatherkit and its currently live and up on the app store, recently I had some users report to me that they had been receiving errors loading weather data, I had error handling built in and it reported an issue with apples authentication server

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

I have not come across this during the development lifecycle of my project, there where no codebase changes, it just stopped functioning.

The app entitlements are valid and correct, Weatherkit is enabled in both xcode and across my Certs, identifiers and profiles.

I was not experiencing this issue until I reinstalled the app from the app store completly by first removing it and then re-installing fresh.

Hard reboots do not help and I do not want to start suggesting to my users to factory reset their devices.

  • We are using WeatherKit in both our main app and widget, relying entirely on Apple’s framework for authentication and token management.

  • We do not generate or inject our own JWT tokens; all token handling is managed by WeatherKit.

  • We have implemented a debug menu with the following actions:

  • Clear WeatherKit JWT tokens from the keychain

  • Clear all related UserDefaults key

  • Clear all app group data and all UserDefaults.

  • Perform a “nuclear” cache clear (removes all app data, keychain, and cached files).

We log all WeatherKit fetch attempts and failures, including authentication errors, both in the app and widget and get nothing but code 2.

We have attempted all of the above steps, but continue to experience issues with WeatherKit JWT authentication

We would appreciate any guidance or insight into what else could be causing persistent WeatherKit JWT/authentication issues, or if there are any additional steps we should try.

P.S. - Tested and experiencing the same issues on an iPhone 15 Pro Max and iPhone 15

The Pro Max is on the iOS 26 Beta // and the 15 is on the latest iOS 18

Answered by in 845879022

Thank you for reporting this. The issue should now be resolved.

Additionally, I wanted to share a peculiar, device-specific observation that may help diagnose the underlying issue:

Persistent Failure State on a Single Device After the first occurrence of the JWT-generation error on a given device, even previously working builds (including the current production version) begin failing with the same WeatherKit JWT error on that device. In contrast, other devices that have never encountered this error continue to run those same builds without issue. Uninstalling the app from the “stuck” device does not clear the problem—subsequent reinstalls of builds that worked before still fail immediately.

Steps Already Taken

  • Rebuilt and reinstalled known-good versions on the affected device.

  • Regenerated provisioning profiles and confirmed entitlements are correctly embedded.

  • Rebooted the device, reset network/location/privacy settings, and signed out/in of Apple ID.

  • Confirmed that other devices (same iOS version, same app binary) remain unaffected until they trigger the error the first time.

  • Verified device date/time and network connectivity to Apple endpoints.

Implication

This behavior strongly suggests that once WeatherKit’s auth flow fails initially, some daemon or OS-level cache enters a bad state on that device, which persists across app reinstalls. It appears independent of the app binary itself (since older known-good builds also break), and is isolated to that device.

We have the same issue with similar setup. It stopped working all of a sudden without any changes to the codebase or entitlements. This is affecting a lot of users for us, mainly in the US, for users with iOS18.5.

I get the exact same errors. It works perfecetly from Canada, but my users with the same app in the Kensas City area gets the same error.

This is kind of critical for Apple to fix.

As if by magic, my app started functioning again and no more of the aforementioned error..

Thank you for reporting this. The issue should now be resolved.

JWT Token Errors
 
 
Q