firebase-admin-go icon indicating copy to clipboard operation
firebase-admin-go copied to clipboard

FR: MFA support revisted

Open axelsly opened this issue 3 years ago • 3 comments
trafficstars

Describe your environment

  • Operating System version: All
  • Firebase SDK version: v4.7.1
  • Firebase Product: auth

Describe the problem

Circling back on #421, looking to add MFA to a user. MFA exists in the Node SDK, are there plans to add this to Golang SDK in the near-term?

axelsly avatar Mar 18 '22 21:03 axelsly

MFA support is added to UserRecord in https://github.com/firebase/firebase-admin-go/pull/422. Should be available since v4.5.0

lahirumaramba avatar Mar 30 '22 18:03 lahirumaramba

@lahirumaramba Reopening this as there may have been some confusion. Looking to add MFA to a user when calling CreateUser or UpdateUser. For example, the Node admin SDK lets us pass in MFA info when calling such functions:

// @public
export abstract class BaseAuth {
    createUser(properties: CreateRequest): Promise<UserRecord>;
    updateUser(uid: string, properties: UpdateRequest): Promise<UserRecord>;
}

// @public
export interface CreateRequest extends UpdateRequest {
    multiFactor?: MultiFactorCreateSettings;
    uid?: string;
}

// @public
export interface UpdateRequest {
    disabled?: boolean;
    displayName?: string | null;
    email?: string;
    emailVerified?: boolean;
    multiFactor?: MultiFactorUpdateSettings;
    password?: string;
    phoneNumber?: string | null;
    photoURL?: string | null;
    providersToUnlink?: string[];
    providerToLink?: UserProvider;
}

Furthermore, from the Identity Platform console, we can also manually add MFA to an email verified user:

image Screen Shot 2022-04-11 at 2 49 07 PM

Are there any plans to extend UserToCreate or UserToUpdate to implement this? Alternatively, perhaps support wrappers to v2/accounts/mfaEnrollment:start and v2/accounts/mfaEnrollment:finalize?

axelsly avatar Apr 11 '22 18:04 axelsly

Hi @axelsly, sorry for the confusion. #422 only partially implements the MFA API in Go SDK. This is not on our roadmap currently so I am unable to promise a timeline. Let's re-open this issue so we can track any progress here. We are also happy to accept any pull-requests if you or anyone else in the community would like to contribute. :) Thanks!

lahirumaramba avatar Apr 13 '22 17:04 lahirumaramba

MFA support was added in UserToCreate or UserToUpdate in https://github.com/firebase/firebase-admin-go/pull/511/files and should be available in v4.10.0 or newer. Thank you!

lahirumaramba avatar Nov 15 '22 22:11 lahirumaramba