Skip to content

Conversation

@aryasaatvik
Copy link
Contributor

@aryasaatvik aryasaatvik commented Apr 5, 2025

branched from #246 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.
…ionServices

- Improved error handling for missing or invalid provider and client credentials in the issuer function.
- Updated Apple OIDC provider to support client_credentials flow using Apple ID Token, including verification of id_token and app_id.
- Made clientSecret optional in the provider interface to accommodate varying provider implementations.
@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2025

⚠️ No Changeset found

Latest commit: fbb07dd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@aryasaatvik aryasaatvik closed this by deleting the head repository May 18, 2025
@wootencl
Copy link

wootencl commented May 28, 2025

Hey @aryasaatvik, a bit delayed here but was following along. What was the reason for closing?

@ahwelgemoed
Copy link

Was following here but I think it will be resolved here #284

nullfunc added a commit to DefangLabs/openauth that referenced this pull request Sep 4, 2025
Co-authored-by: Eric Liu <[email protected]>
Co-authored-by: Eric Liu <[email protected]>
nullfunc added a commit to DefangLabs/openauth that referenced this pull request Sep 4, 2025
Co-authored-by: Eric Liu <[email protected]>
Co-authored-by: Eric Liu <[email protected]>
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

3 participants