Swift Auth SDK doesn't attach Sign in with Apple's accessToken & refreshTokens to Auth.Session
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- authentication
Research direction
Start with the Swift SDK signInWithIdToken call and inspect how Auth.Session maps providerAccessToken and providerRefreshToken from the Supabase Auth response. Then trace the corresponding Apple sign-in handling in the Go auth service; done means Apple’s access and refresh tokens are available in those Session fields without requiring a second authentication flow.
Written by the indexing model from the issue text.
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
The Auth.Session object returned by Supabase's Swift SDK after attempting a Sign in with Apple doesn't appear to return Apple's accessToken or refreshToken in the providerAccessToken or providerRefreshToken fields.
let appleIDSession = try await supabaseClient.auth.signInWithIdToken(
credentials: .init(provider: .apple, idToken: idToken)
)
Checking appleIDSession, you'll see that providerAccessToken and providerRefreshToken are nil and the session's returned accessToken and refreshToken appear to be a Supabase accessToken & refreshToken.
This is troublesome as in trying to Sign in With Apple's token revocation on account deletion by the user, we need to send the Apple accessToken and refreshTokens as documented here: https://github.com/supabase/auth/issues/1308#issuecomment-2518664931
If one instead takes the Apple authorization code and manually hits Apple's token API endpoint, we can get the correct Apple accessToken & refreshToken, but then Supabase will be unable to use the IdToken as it is one-time use and would force us to do a second auth it seems.
Is there any other way to access these from the database side in our Edge Functions?
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- With Supabase Swift SDK, do Sign in With Apple using the following:
let appleIDSession = try await supabaseClient.auth.signInWithIdToken(
credentials: .init(provider: .apple, idToken: idToken)
)
- Review the access and refresh token properties and note how none seem to be the Apple access token & refresh token
Expected behavior
Sign in with Apple's accessToken and refreshToken should fill in to Auth.Session's providerAccessToken and providerRefreshToken
Screenshots
N/A
System information
- OS: iOS with Supabase Swift SDK
- Browser (if applies): N/A
- Version of supabase-js: N/A
- Version of Node.js: N/A
Additional context
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 764
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/auth
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100