Skip to content
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

[Feature] Provide Reauthenticate method under CrossFirebaseAuth.Current.CurrentUser #52

Closed
Kapusch opened this issue Jul 17, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Kapusch
Copy link
Contributor

Kapusch commented Jul 17, 2022

Hi @TobiasBuchholz , recently Apple requested app developers to provide a way for their users to delete their account.

I was happy to find the DeleteAsync method under CrossFirebaseAuth.Current.CurrentUser, however I have faced a FIRAuthErrorCodeRequiresRecentLogin which basically indicates the user has attempted a sensitive operation more than 5 minutes after signing in, and then requires recent authentication.

I could prompt a dialog for the user to be able to reauthenticate, however this is not suitable for users who signed in with Google, Facebook or Apple.

I can explain to my users that they need to reauthenticate and quickly go for the deletion of their account, however this would be neat having a Reauthenticate method under CrossFirebaseAuth.Current.CurrentUser.

I can see from the docs there is a way to do so with providers as well.

@TobiasBuchholz TobiasBuchholz added the enhancement New feature or request label Aug 22, 2022
@angelru
Copy link

angelru commented Apr 14, 2023

@Kapusch I am facing the same issue, how did you solve it?

@Kapusch
Copy link
Contributor Author

Kapusch commented Apr 15, 2023

Hey @angelru , I did not solve it actually. All I was able to do is catching error code for FIRAuthErrorCodeRequiresRecentLogin:
catch (Exception ex) when (ex.Message.Contains("17014"))

so that I can inform the user must re-authenticate for security reasons before they can delete their account.

Note: this DeleteAsync() method only remove the user from the Firebase instance, you still have to delete all the Firestore / Storage data manually.

@AdamEssenmacher
Copy link
Collaborator

This plugin is built on the Xamarin.iOS bindings published by Microsoft. The reauthenticate method in these bindings has been broken since version 6, and this PR to fix it is almost a year old.

So, while this plugin could be extended to include this iOS API, it won't actually work until one of two things happens:

  1. Microsoft updates its iOS Firebase bindings.
  2. This plugin migrates away from Microsoft's iOS Firebase bindings.

@AdamEssenmacher
Copy link
Collaborator

This should be fixed with 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants