Nedo.AspNet.Authentication.Apple 2.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nedo.AspNet.Authentication.Apple --version 2.0.7
                    
NuGet\Install-Package Nedo.AspNet.Authentication.Apple -Version 2.0.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nedo.AspNet.Authentication.Apple" Version="2.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nedo.AspNet.Authentication.Apple" Version="2.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Nedo.AspNet.Authentication.Apple" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nedo.AspNet.Authentication.Apple --version 2.0.7
                    
#r "nuget: Nedo.AspNet.Authentication.Apple, 2.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nedo.AspNet.Authentication.Apple@2.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nedo.AspNet.Authentication.Apple&version=2.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Nedo.AspNet.Authentication.Apple&version=2.0.7
                    
Install as a Cake Tool

Nedo.AspNet.Authentication.Apple

"Sign in with Apple" — your app mints its own JWTs after verifying an Apple-issued ID token from the Apple JS SDK on the SPA side.

Install

dotnet add package Nedo.AspNet.Authentication.Apple

Quickstart

using Nedo.AspNet.Authentication.Apple;

builder.Services.AddApple(opts =>
{
    opts.ServiceId = builder.Configuration["Apple:ServiceId"]!;   // e.g. "com.example.app.web"
});

var app = builder.Build();
app.MapLocalAuth();
app.MapLocalAccount();
app.MapAppleAuth();   // POST /auth/apple { idToken, user?, intent? }

Frontend (SPA)

Apple's JS SDK gives you the ID token + (only on first sign-in) the user's name:

<script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>
AppleID.auth.init({
  clientId: import.meta.env.VITE_APPLE_SERVICE_ID,
  redirectURI: window.location.origin,
  scope: 'name email',
  usePopup: true,
});
const data = await AppleID.auth.signIn();

const tokens = await fetch('/auth/apple', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    idToken: data.authorization.id_token,
    user: data.user ? JSON.stringify(data.user) : undefined,  // only present on first sign-in
    intent: 'signin',
  }),
}).then(r => r.json());

The first-sign-in name quirk

Apple sends the user's name (firstName, lastName) only on the very first authorization. If your backend wasn't ready or you didn't capture it, you'll never see it again — Apple's privacy posture. The endpoint stores it on the local user when present, so subsequent sign-ins still have a display name.

Console setup

  1. https://developer.apple.com/account/resources/identifiers/list → register an App ID with Sign In with Apple capability.
  2. Register a Services ID (e.g. com.example.app.web) — this is your ServiceId config value.
  3. Configure the Services ID with your domain + return URL.
  4. Generate a .p8 private key with Sign In with Apple access (server-side flows only — the SPA-side ID-token-exchange flow this package uses doesn't need the private key).

Full walkthrough: docs/providers/social/apple.md.

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.9 98 5/11/2026
2.0.8 90 5/6/2026
2.0.7 85 5/5/2026
2.0.6 85 5/5/2026
2.0.4 83 5/4/2026
2.0.3 83 5/4/2026
2.0.2 93 5/2/2026
2.0.1 83 5/2/2026
2.0.0 82 5/1/2026