Hi all!

In my spare time I put together idunn, a Sign in with Apple create for Rust backends, just published version 0.1.0. I started this because I needed Sign in with Apple on an app's backend, and none of the existing crates seemed really helpful on this.
You can find it at:

Apple's docs leave lot for the backend dev to piece together. idunn's guide principle is to be easy to use correctly and hard to use incorrectly: the obvious way to integrate should be the correct (and Apple-compliant) way. It runs the whole sign-in in a single sign_up_or_log_in call:

  • verifies the identity token and its nonce
  • exchanges the authorization code and checks that the new token names the same user and nonce
  • guides you on which refresh token to store, which to revoke and which to drop

Beyond that:

  • Apple's signing keys (JWKS) are cached, with rate-limited refetches and backoff after failures
  • revoke_refresh_token covers account deletion, which Apple requires
  • bring your own HTTP client, or use reqwest
  • idunn itself depends on no specific async runtime, but works out of the box tokio or smol

CI enforces at least 90% line coverage and fails if cargo-mutants finds a code change that no test catches. The README has a comparison with the other Sign in with Apple crates; if an entry there is wrong, please tell me.

Feedback on the API is very welcome, and so are issues and pull requests!

Thank You for reading all this. Have fun!

1 post - 2 participants

Read full topic