Skip to content

feat(auth): implement linkIdentity with OIDC #776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

grdsdev
Copy link
Collaborator

@grdsdev grdsdev commented Aug 8, 2025

What kind of change does this PR introduce?

Feature - implements identity linking functionality using OpenID Connect credentials.

What is the current behavior?

Currently, the Swift Auth client only supports signing in with OIDC credentials but doesn't provide a way to link additional identities to an existing user account using OIDC.

What is the new behavior?

  • Added linkIdentityWithIdToken method to AuthClient that allows linking an OIDC identity to the current user
  • Refactored existing signInWithIdToken method to support both sign-in and identity linking flows through an internal _signInWithIdToken helper
  • Added linkIdentity property to OpenIDConnectCredentials to distinguish between sign-in and linking operations
  • Improved code formatting consistency throughout the affected files

The new method follows the same pattern as other identity linking methods in the client.

Additional context

This implements the OIDC identity linking functionality referenced in the branch name (clibs-283). The implementation maintains backward compatibility while adding the new linking capability.

Close #588

🤖 Generated with Claude Code

- Add linkIdentityWithIdToken method to AuthClient
- Refactor signInWithIdToken to support identity linking
- Add linkIdentity property to OpenIDConnectCredentials
- Improve code formatting consistency

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16830739839

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 16 of 18 (88.89%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 77.47%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Sources/Auth/AuthClient.swift 15 17 88.24%
Files with Coverage Reduction New Missed Lines %
Sources/Auth/AuthClient.swift 1 88.54%
Totals Coverage Status
Change from base Build 16828663196: 0.03%
Covered Lines: 5529
Relevant Lines: 7137

💛 - Coveralls

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.

Link apple identity natively
2 participants