Swift Auth SDK doesn't attach Sign in with Apple's accessToken & refreshTokens to Auth.Session
Bug report
- [X] I confirm this is a bug with Supabase, not with my own application.
- [X] 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