[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node)
@lahirumaramba arbeitet bereits daran.
Seit 05.5.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Is your feature request related to a problem? Please describe.
The Identity Toolkit accounts:sendOobCode endpoint supports a VERIFY_AND_CHANGE_EMAIL request type that generates an OOB link which, when followed, both verifies the new address and updates the user's email. This is the recommended way to implement a secure "change email" flow — the verification link is sent to the current address so the flow isn't vulnerable to a stolen session setting a new email without the original owner's knowledge.
The Python Admin SDK cannot generate these links today. firebase_admin/_auth_utils.py declares:
VALID_EMAIL_ACTION_TYPES = set(['VERIFY_EMAIL', 'EMAIL_SIGNIN', 'PASSWORD_RESET'])
validate_action_type() rejects 'VERIFY_AND_CHANGE_EMAIL' before the request is made, and there is no new_email parameter on generate_email_action_link to carry the target address.
Describe the solution you'd like
Mirror the API added to firebase-admin-node in firebase/firebase-admin-node#1633 (merged April 2022):
- Add
'VERIFY_AND_CHANGE_EMAIL'toVALID_EMAIL_ACTION_TYPES. - Add an optional
new_email: str | None = Noneparameter togenerate_email_action_link(and the correspondingClient/authmodule methods), required whenaction_type == 'VERIFY_AND_CHANGE_EMAIL'. - Include
newEmailin theaccounts:sendOobCodepayload when set.
For reference, the Node signature is:
generateEmailActionLink(requestType, email, actionCodeSettings?, newEmail?)
Describe alternatives you've considered
Calling accounts:sendOobCode directly through Client._user_manager._make_request(...) with {"requestType": "VERIFY_AND_CHANGE_EMAIL", "email": ..., "newEmail": ..., "returnOobLink": True, ...}, reusing firebase_admin._user_mgt.encode_action_code_settings for ActionCodeSettings serialization. This works but depends on SDK internals (private _user_manager, private _make_request, private encode_action_code_settings) and bypasses the SDK's validation and error mapping.
Additional context
- Node SDK PR adding the same feature: firebase/firebase-admin-node#1633
- The Identity Toolkit
requestTypeenum already includesVERIFY_AND_CHANGE_EMAIL; the REST surface is unchanged. - Verified against
firebase-admin7.4.0.
- Vorherrschende Sprache
- Python
- Sterne
- 1.2k
- Forks
- 359
- Ø Merge
- 5 T. 6 Min.
- Gemergte PRs (30 T.)
- 2
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus firebase/firebase-admin-python
-
api: remoteconfig
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
firebase/firebase-admin-python#957 · 1 Kommentar ·
-
api: database type: feature request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
firebase/firebase-admin-python#978 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 43/100
firebase/firebase-admin-python#945 · 1 Kommentar · 1 Reaktion ·
-
type: feature request
firebase/firebase-admin-python#915 · 5 Kommentare · 3 Reaktionen · 3 zugewiesene Personen ·
Alle Issues in firebase/firebase-admin-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100