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

Firebase Auth TOTP support #11261

Merged
merged 15 commits into from Jun 29, 2023
Merged

Firebase Auth TOTP support #11261

merged 15 commits into from Jun 29, 2023

Conversation

Xiaoshouzi-gh
Copy link
Contributor

@Xiaoshouzi-gh Xiaoshouzi-gh commented May 9, 2023

Added TOTP MFA support for iOS SDK

…equest (#11128)

* Updated finalizeMfaSignInRequest to take TOTP factor.
* Added request unit tests and marked finalizeMFASignInRequest tests as iOS only
@google-oss-bot
Copy link

google-oss-bot commented May 9, 2023

1 Warning
⚠️ New public headers were added, did you remember to add them to the umbrella header?

Generated by 🚫 Danger

TOTP Enrollment Flow
@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2023

Apple API Diff Report

Commit: 84f7dc4
Last updated: Fri Jun 23 12:15 PDT 2023
View workflow logs & download artifacts


FirebaseAuth

Classes

[ADDED] FIRTOTPMultiFactorGenerator
[ADDED] FIRTOTPMultiFactorGenerator
Objective-C:
+  @interface FIRTOTPMultiFactorGenerator : NSObject
+    + ( void ) generateSecretWithMultiFactorSession : ( nonnull FIRMultiFactorSession * ) session completion :( nonnull void ( ^ )( FIRTOTPSecret * _Nullable , NSError * _Nullable )) completion ;
+    + ( nonnull FIRTOTPMultiFactorAssertion * ) assertionForEnrollmentWithSecret :( nonnull FIRTOTPSecret * ) secret oneTimePassword :( nonnull NSString * ) oneTimePassword ;
+    + ( nonnull FIRTOTPMultiFactorAssertion * ) assertionForSignInWithEnrollmentID :( nonnull NSString * ) enrollmentID oneTimePassword :( nonnull NSString * ) oneTimePassword ;
[ADDED] FIRTOTPSecret
[ADDED] FIRTOTPSecret
Swift:
+  class TOTPSecret : NSObject
+    func sharedSecretKey () -> String
+    func generateQRCodeURL ( withAccountName accountName : String , issuer : String ) -> String
+    func openInOTPApp ( withQRCodeURL QRCodeURL : String )
Objective-C:
+  @interface FIRTOTPSecret : NSObject
+    - ( nonnull NSString * ) sharedSecretKey ;
+    - ( nonnull NSString * ) generateQRCodeURLWithAccountName :( nonnull NSString * ) accountName issuer :( nonnull NSString * ) issuer ;
+    - ( void ) openInOTPAppWithQRCodeURL :( nonnull NSString * ) QRCodeURL ;
[ADDED] FIRTOTPMultiFactorAssertion
[ADDED] FIRTOTPMultiFactorAssertion
Objective-C:
+  @interface FIRTOTPMultiFactorAssertion : FIRMultiFactorAssertion

Constants

[ADDED] FIRTOTPMultiFactorID
[ADDED] FIRTOTPMultiFactorID
Objective-C:
+  extern NSString * const _Nonnull FIRTOTPMultiFactorID

@google-oss-bot
Copy link

Size Report 1

Affected Products

  • FirebaseAuth

    TypeBase (9143c4b)Merge (99319de)Diff
    CocoaPods?-51.5 kB? (?)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/uvZHj4OTHR.html

* Added TOTP Assertion and Generator logics
@google-oss-bot
Copy link

google-oss-bot commented Jun 2, 2023

Coverage Report 1

Affected Products

  • FirebaseAuth-iOS-FirebaseAuth.framework

    Overall coverage changed from 69.44% (1ef1ea2) to 68.99% (84f7dc4) by -0.45%.

    17 individual files with coverage change

    FilenameBase (1ef1ea2)Merge (84f7dc4)Diff
    FIRAuthBackend+MultiFactor.m0.00%37.89%+37.89%
    FIRAuthBackend.m83.94%82.20%-1.73%
    FIRAuthProtoFinalizeMFATOTPEnrollmentRequestInfo.m?100.00%?
    FIRAuthProtoFinalizeMFATOTPEnrollmentResponseInfo.m?0.00%?
    FIRAuthProtoFinalizeMFATOTPSignInRequestInfo.m?100.00%?
    FIRAuthProtoMFAEnrollment.m100.00%89.47%-10.53%
    FIRAuthProtoStartMFATOTPEnrollmentRequestInfo.m?100.00%?
    FIRAuthProtoStartMFATOTPEnrollmentResponseInfo.m?0.00%?
    FIRFinalizeMFAEnrollmentRequest.m0.00%64.29%+64.29%
    FIRFinalizeMFASignInRequest.m0.00%87.50%+87.50%
    FIRMultiFactor.m12.45%12.12%-0.33%
    FIRMultiFactorResolver.m12.50%11.34%-1.16%
    FIRStartMFAEnrollmentRequest.m0.00%62.16%+62.16%
    FIRTOTPMultiFactorAssertion.m?0.00%?
    FIRTOTPMultiFactorGenerator.m?0.00%?
    FIRTOTPMultiFactorInfo.m?0.00%?
    FIRTOTPSecret.m?0.00%?

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/E4AP2b0s6t.html

* Adding unenroll support for TOTP on sample app

* lint fixes
* provide missing TOTP factor type of error in the error hints

* refactor all sign in with MFA code in all related workflow for Sample App
* updated invalid verification code error msg
@Xiaoshouzi-gh
Copy link
Contributor Author

@kevinthecheung Hi Kevin, can you help with the documentation review? All code merged in this branch has already been approved by SWEs.

@Xiaoshouzi-gh Xiaoshouzi-gh marked this pull request as ready for review June 14, 2023 05:01
* changes to umbrella and changelog

* Update CHANGELOG.md

* Update version as per PR feedback
Copy link
Contributor

@renkelvin renkelvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
@Xiaoshouzi-gh Xiaoshouzi-gh merged commit dc754ba into master Jun 29, 2023
34 checks passed
@Xiaoshouzi-gh Xiaoshouzi-gh deleted the totp-release-0413 branch June 29, 2023 17:42
Xiaoshouzi-gh added a commit that referenced this pull request Jun 29, 2023
peterfriese pushed a commit that referenced this pull request Jul 14, 2023
Added Time-based One Time Password MFA support.

Co-authored-by: pragatimodi <110490169+pragatimodi@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
@firebase firebase locked and limited conversation to collaborators Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants