Skip to content

Conversation

@aryasaatvik
Copy link
Contributor

branched from #283 which fixed issues in Apple OIDC provider

resolves #210

adds support for direct integration with iOS/macOS AuthenticationServices (Sign in with Apple) by updating the AppleOidcProvider to validate Apple ID tokens via the client_credentials grant type.

Previously, OpenAuth had no way to directly validate Apple ID tokens obtained from iOS apps using the native Sign in with Apple flow. This required app developers to either:

  1. Implement a separate authentication service for iOS
  2. Use a custom web view that disrupted the native iOS experience
  3. Send tokens to a custom backend for validation

This PR extends the OpenAuth client_credentials grant type to handle Apple ID token verification, allowing iOS applications to authenticate directly with the OpenAuth server:

  1. The iOS app obtains an ID token through Apple's ASAuthorizationAppleIDProvider
  2. The app sends this token to OpenAuth's /token endpoint via client_credentials grant
  3. OpenAuth validates the token against Apple's JWKS and returns OpenAuth access/refresh tokens
  4. The iOS app uses these tokens like any other OpenAuth client

- Added `clientSecret` and `responseType` options to the Apple OIDC
provider.
- Updated OIDC configuration to include `tokenEndpointAuthMethod`.
- Implemented handling for authorization code flow in the OIDC provider,
including token exchange logic.
…le flow (sst#4)

branched from sst#3 which fixed issues in Apple OIDC provider

resolves sst#210 

adds support for direct integration with iOS/macOS
[AuthenticationServices](https://developer.apple.com/documentation/authenticationservices/implementing-user-authentication-with-sign-in-with-apple)
(Sign in with Apple) by updating the AppleOidcProvider to validate Apple
ID tokens via the client_credentials grant type.

Previously, OpenAuth had no way to directly validate Apple ID tokens
obtained from iOS apps using the native Sign in with Apple flow. This
required app developers to either:
1. Implement a separate authentication service for iOS
2. Use a custom web view that disrupted the native iOS experience
3. Send tokens to a custom backend for validation


This PR extends the OpenAuth client_credentials grant type to handle
Apple ID token verification, allowing iOS applications to authenticate
directly with the OpenAuth server:
1. The iOS app obtains an ID token through Apple's
ASAuthorizationAppleIDProvider
2. The app sends this token to OpenAuth's /token endpoint via
client_credentials grant
3. OpenAuth validates the token against Apple's JWKS and returns
OpenAuth access/refresh tokens
4. The iOS app uses these tokens like any other OpenAuth client
@changeset-bot
Copy link

changeset-bot bot commented Jun 22, 2025

🦋 Changeset detected

Latest commit: f55799f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable native iOS/Android Sign in with Apple/Google login flows

1 participant