firebase / firebase/firebase-unity-sdk
[FR]: Add Email Link Authentication
- Dominant language
- C#
- Stars
- 320
- Forks
- 60
- Avg merge
- 11h 15m
- Merged PRs (30d)
- 11
Description
### Description
1. Email Link Authentication would allow users to sign up or sign in easily without using a password, making it really simple and secure
2. While it is a feature of Firebase Authentication [(Docs)](https://firebase.google.com/docs/auth/web/email-link-auth) the Unity SDK doesn't support it yet
3. Functions like SendSignInLinkToEmailAsync(), the deep linking could be handled by unity itself
### API Proposal
| API | Signature | Purpose |
|------|-----------|---------|
| `ActionCodeSettings` | Class with properties: `Url`, `HandleCodeInApp`, `AndroidPackageName`, `InstallApp`, `MinimumVersion`, `IOSBundleId`, `DynamicLinkDomain` | Configure how the email sign-in link is built (redirect URL, platform info, etc.) |
| `SendSignInLinkToEmailAsync` | `(string email, ActionCodeSettings settings)` → `Task` | Sends a passwordless sign-in email link to the user’s email address. |
| `IsSignInWithEmailLink` | `(string link)` → `bool` | Checks if the given URL is a valid sign-in-with-email link generated by Firebase. |
| `SignInWithEmailLinkAsync` | `(string email, string link)` → `Task` | Completes the sign-in flow using the email and the link clicked by the user. |
| `EmailAuthProvider.GetCredentialWithLink` | `(string email, string link)` → `Credential` | Creates a credential object for linking or reauthenticating a user with email link credentials. |
### Firebase Product(s)
_No response_
### Targeted Platform(s)
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.