#apple #jwt #sign-in #api-bindings

apple-signin

Decodes and validates identity tokens generated via Sign in with Apple

2 releases

0.1.1 Jan 19, 2024
0.1.0 Jan 19, 2024

#921 in Web programming

31 downloads per month

MIT license

15KB
196 lines

Apple Sign In for Rust

Crates.io Docs

This crate provides an API to verify and decode Apple's identity JWT, typically generated via the AuthenticationServices iOS Framework.

Usage

Add apple-signin to your project.

cargo add apple-signin

or

[dependencies]
apple-signin = "*"

And then, you can verify an identityToken obtained from ASAuthorizationAppleIDCredential

use apple_signin::AppleJwtClient;

#[tokio::main]
async fn main() -> Result<()> {
    let mut client = AppleJwtClient::new(&["com.example.myapp"]);
    let payload = client.decode("[IDENTITY TOKEN]").await?;

    dbg!(payload);

    Ok(())
}

For more detailed instructions, check out the documentation.

License

Dependencies

~4–18MB
~274K SLoC