You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apple's new guidelines say, If your app offers sign-in with Apple, you must use sign-in with the Apple REST API to revoke your user token when you delete your account. https://developer.apple.com/news/?id=12m75xbj
Does Firebase Auth offer any functionality to assist with account deletion?
Reacted by Cal Holloway, Paco777, amirchb, Javier Vieira, Deepak, Dinesh Vijaykumar, Mike Hardy, lucas nascimento, Peter Pohlmann, Julian Ewers-Peters and 20 more
To delete any of the user's associated data, you can use the Delete User Data Extension. This essentially is a Cloud Function that will run whenever a Firebase Auth user account is deleted (either using the call above or via the Firebase console), and can delete the user's data in Cloud Firestore, Cloud Storage, and the Realtime Database.
If you find that your data model is different from what the Extension currently supports:
Please consider leaving feedback on the Firebase Extensions repo (file a feature request outlining how your data model looks like)
Consider implementing your own Cloud Function based on the code of the Delete User Data Extension
Firebase SDK did not call Apple's revoke token endpoint when I deleted my Firebase account.
I have a few questions.
What should be the flow for calling Apple's revoke token endpoint when deleting a Firebase account?
Do I need to implement my own Cloud Function?
Also, can I get the necessary parameters for Apple's revoke token endpoint?
Are there any plans to support calling Apple's revoke token endpoint in the Firebase SDK?
Regards
Reacted by Cal Holloway, Paco777, amirchb, algrid, DennisAshford, Deepak, Rafael B.C., KeisukeYamashita, Omri Poran, Khoa Tran and 2 more
+1 Apple is complaining about this being a requirement June 30th. Looks like apps wont be accepted after that date if they do not delete tokens. This is the message:
Starting June 30, 2022, apps submitted to the App Store that support account creation must also include an option to initiate account deletion.
We noticed this app may support account creation. If it does not, you may disregard this message. If it already offers account deletion or you’re working to implement it, we appreciate your efforts to follow the App Store Review Guidelines. Apps submitted after June 30 that do not comply with the account deletion requirements in guideline 5.1.1(v) will not pass review.
Learn more about the account deletion requirements. If your app offers Sign in with Apple, use the Sign in with Apple REST API to revoke user tokens.
Reacted by Idan, Rafael B.C., Remy Chantenay and Jesus (iOS)
+1 this is a real problem to be addressed before June 30.
Either implement it automatically in the SDK (would be great) or give us access to the requested parameters so we can do it ourselves.
I don't think it makes sense to offer this with Firebase SDK. This is something the developer has to handle independently with apple auth. You can get the client secrets and token strings during login or sign up. It is decoupled from the Firebase flows.
However, apple has provided very poor documentation for how to implement this. Even if you test their API with something like postman, you will always get status code 200 even with incorrect parameters.
Perhaps you could help explain how this could be implemented, for clarity, I'm using Firebase & Flutter, I use Firebase Auth with flutter and sign_in_with_apple to authenticate with Firebase via the method in the documentation: https://firebase.google.com/docs/auth/flutter/federated-auth
To delete my user, the documentation for firebase/flutter states to call user.delete().
This however would cause an app rejection via Apple's new policy. Is your position that users should know to create their own server outside Firebase, track secrets there after authenticating on Firebase, and then call that server to revoke tokens alongside the calls to firebase to delete the authenticated user?
If so where should that be documented and would a cloud function and Firestore be fine to use to keep track of tokens and revoke on delete?
Reacted by Rafael B.C., Ben Hu and Cristian Moisei
Thanks for raising this issue - we are aware of this and are actively working on a solution. We will update this issue once we can share more details.
Documentation (and accompanying sample code) would definitely be part of the solution. This will likely be a blog post that shows how to use our solution, fast-followed by an update of our docs (https://firebase.google.com/docs/auth/ios/apple).
We would want to avoid developers having to stand up their own servers outside of Firebase - this would defeat the whole purpose of an mBaaS platform.
Reacted by Cal Holloway, Mark Warburton, ihmgsm, Paco777, ddotan, trifocal3, Hirokazu Okawa, Gabriel Diaconita, Youngho Joo, Julian Ewers-Peters and 24 more
Reacted by Cal Holloway, Mark Warburton, ddotan, trifocal3, Gabriel Diaconita, algrid, Elio, Remy Chantenay, Philipp Bauer, KeisukeYamashita and 3 more
Apple's revoke API is called based on JWT signed by the developer's key, so I think it will be difficult for the client to implement the function. I think it's most intuitive to upload a key file from the Firebase console (like cloud messaging) and automatically process it when user.delete(). However, with Apple's instruction request date just around the corner, the way to generate JWT and invoke API via Firebase functions seems not bad.
@paulb777 Just to confirm, is the expected behaviour that calling Auth.auth().currentUser.delete { .. } should revoke the token automatically also? I tested this now so using 10.8.1, called delete but the token still appears in the apple id page. Could it be because the app isn't live on the app store?
Hi @CristianMoisei - token revocation needs to triggered separately from deleting the user account.
We're currently working on updating the docs (and a video is also on the way), but broadly speaking, you will have to do the following:
Make sure you filled out the Services ID and OAuth code flow configuration
section of the Sign in with Apple provider configuration in the Firebase console
Since Firebase does not store user tokens when users are created with Sign in with Apple, you must ask the user to sign in again before revoking their token and deleting the account. To avoid confusing users, you should show a dialog first, telling the user that they need to authorize deleting their account. For an example of how to do this, have a look at the Craft app
Obtain the authorization code from the ASAuthorizationAppleIDCredential, and use it to call Auth.auth().revokeToken(withAuthorizationCode:) to revoke the user's tokens.
Finally, delete the user account (and all associated data)
This works independently of whether your app is in the App Store or not.
Reacted by Paul Beusterien and Julian Ewers-Peters
I was wondering what would be best practice for handling token revocation while using the local Firebase emulator?
When attempting to revoke the token with the Auth.auth().revokeToken(withAuthorizationCode: authCode) function, FIRAuthErrorDomain 17004 error is thrown which refers to "ERROR_INVALID_CREDENTIAL".
Would simply skipping the above function be the way to go if the local emulator is being used?
@peterfriese sorry, but Auth.auth().revokeToken(withAuthorizationCode:) method is absent in the latest master branch.
I imported FirebaseCore, FirebaseAuth
Activity
linkillhz commentedon Jun 14, 2022
A similar question has been asked on stack overflow.
https://stackoverflow.com/questions/72415814/where-i-get-from-ios-firebase-api-the-apple-revoke-tokens-endpoint-parameters-c
peterfriese commentedon Jun 14, 2022
Hi @linkillhz -
you can delete user accounts in Firebase Auth using
user.delete():See the docs for more details.
To delete any of the user's associated data, you can use the Delete User Data Extension. This essentially is a Cloud Function that will run whenever a Firebase Auth user account is deleted (either using the call above or via the Firebase console), and can delete the user's data in Cloud Firestore, Cloud Storage, and the Realtime Database.
If you find that your data model is different from what the Extension currently supports:
As for revoking the token, @rosalyntan and @renkelvin can provide more details.
linkillhz commentedon Jun 15, 2022
Hi, @rosalyntan and @renkelvin
Firebase SDK did not call Apple's revoke token endpoint when I deleted my Firebase account.
I have a few questions.
What should be the flow for calling Apple's revoke token endpoint when deleting a Firebase account?
Do I need to implement my own Cloud Function?
Also, can I get the necessary parameters for Apple's revoke token endpoint?
Are there any plans to support calling Apple's revoke token endpoint in the Firebase SDK?
Regards
CalHoll commentedon Jun 16, 2022
+1 Apple is complaining about this being a requirement June 30th. Looks like apps wont be accepted after that date if they do not delete tokens. This is the message:
Paco777 commentedon Jun 17, 2022
+1 this is a real problem to be addressed before June 30.
Either implement it automatically in the SDK (would be great) or give us access to the requested parameters so we can do it ourselves.
CalHoll commentedon Jun 18, 2022
Perhaps you could help explain how this could be implemented, for clarity, I'm using Firebase & Flutter, I use Firebase Auth with flutter and sign_in_with_apple to authenticate with Firebase via the method in the documentation: https://firebase.google.com/docs/auth/flutter/federated-auth
To delete my user, the documentation for firebase/flutter states to call
user.delete().This however would cause an app rejection via Apple's new policy. Is your position that users should know to create their own server outside Firebase, track secrets there after authenticating on Firebase, and then call that server to revoke tokens alongside the calls to firebase to delete the authenticated user?
If so where should that be documented and would a cloud function and Firestore be fine to use to keep track of tokens and revoke on delete?
peterfriese commentedon Jun 18, 2022
Hi all -
Thanks for raising this issue - we are aware of this and are actively working on a solution. We will update this issue once we can share more details.
Documentation (and accompanying sample code) would definitely be part of the solution. This will likely be a blog post that shows how to use our solution, fast-followed by an update of our docs (https://firebase.google.com/docs/auth/ios/apple).
We would want to avoid developers having to stand up their own servers outside of Firebase - this would defeat the whole purpose of an mBaaS platform.
jooyoungho commentedon Jun 20, 2022
Apple's revoke API is called based on JWT signed by the developer's key, so I think it will be difficult for the client to implement the function. I think it's most intuitive to upload a key file from the Firebase console (like cloud messaging) and automatically process it when user.delete(). However, with Apple's instruction request date just around the corner, the way to generate JWT and invoke API via Firebase functions seems not bad.
43 remaining items
peterfriese commentedon Apr 20, 2023
This will be launching in the next release of the Firebase SDK.
paulb777 commentedon Apr 20, 2023
Actually, my understanding is that this was fixed in #11001 and already released in 10.8.0.
cc: @renkelvin
CristianMoisei commentedon Apr 20, 2023
@paulb777 Just to confirm, is the expected behaviour that calling Auth.auth().currentUser.delete { .. } should revoke the token automatically also? I tested this now so using 10.8.1, called delete but the token still appears in the apple id page. Could it be because the app isn't live on the app store?
peterfriese commentedon Apr 20, 2023
Hi @CristianMoisei - token revocation needs to triggered separately from deleting the user account.
We're currently working on updating the docs (and a video is also on the way), but broadly speaking, you will have to do the following:
Make sure you filled out the Services ID and OAuth code flow configuration
section of the Sign in with Apple provider configuration in the Firebase console
Since Firebase does not store user tokens when users are created with Sign in with Apple, you must ask the user to sign in again before revoking their token and deleting the account. To avoid confusing users, you should show a dialog first, telling the user that they need to authorize deleting their account. For an example of how to do this, have a look at the Craft app
Obtain the authorization code from the
ASAuthorizationAppleIDCredential, and use it to callAuth.auth().revokeToken(withAuthorizationCode:)to revoke the user's tokens.Finally, delete the user account (and all associated data)
This works independently of whether your app is in the App Store or not.
TheoBo commentedon Apr 21, 2023
I try to understand Peter's recommendations, but do not understand how to get ASAuthorizationAppleIDCredential. We use flutter with firebase_auth.
peterfriese commentedon Apr 21, 2023
I've filed a feature request on the FlutterFire repo for you, @TheoBo
teeeeeegz commentedon Apr 29, 2023
Thank you @peterfriese, works great!
I was wondering what would be best practice for handling token revocation while using the local Firebase emulator?
When attempting to revoke the token with the
Auth.auth().revokeToken(withAuthorizationCode: authCode)function, FIRAuthErrorDomain 17004 error is thrown which refers to "ERROR_INVALID_CREDENTIAL".Would simply skipping the above function be the way to go if the local emulator is being used?
Thanks!
igorzhukov commentedon May 8, 2023
@peterfriese sorry, but
Auth.auth().revokeToken(withAuthorizationCode:)method is absent in the latestmasterbranch.I imported
FirebaseCore,FirebaseAuthpeterfriese commentedon May 8, 2023
It should be there: https://github.com/firebase/firebase-ios-sdk/blob/8efafcb340eb097f4faa2a3c24e46185ff28b28e/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h#LL858C31-L858C31 - can you double check you're either on
masteror on10.8.0or higher?igorzhukov commentedon May 8, 2023
thank you, it's on the
masterforspm.did you update
Cocoapodsbtw?which version/branch should I use for pods
FirebaseandFirebaseAuth?paulb777 commentedon May 8, 2023
CocoaPods and SPM use the same versioning. We release them at the same time.