File tree 3 files changed +32
-0
lines changed
packages/firebase_auth/firebase_auth_web/lib/src
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -963,6 +963,26 @@ class TwitterAuthProvider
963
963
auth_interop.TwitterAuthProviderJsImpl .credential (token, secret);
964
964
}
965
965
966
+ /// SAML auth provider.
967
+ ///
968
+ /// See: <https://firebase.google.com/docs/reference/js/auth.samlauthprovider>.
969
+ class SAMLAuthProvider
970
+ extends AuthProvider <auth_interop.SAMLAuthProviderJsImpl > {
971
+ /// Creates a new SAMLAuthProvider with the providerId.
972
+ /// The providerId must start with "saml."
973
+ factory SAMLAuthProvider (String providerId) => SAMLAuthProvider .fromJsObject (
974
+ auth_interop.SAMLAuthProviderJsImpl (providerId));
975
+
976
+ /// Creates a new SAMLAuthProvider from a [jsObject] .
977
+ SAMLAuthProvider .fromJsObject (auth_interop.SAMLAuthProviderJsImpl jsObject)
978
+ : super .fromJsObject (jsObject);
979
+
980
+ /// Used to extract the underlying OAuthCredential from a UserCredential.
981
+ static auth_interop.OAuthCredential ? credentialFromResult (
982
+ auth_interop.UserCredentialJsImpl userCredential) =>
983
+ auth_interop.SAMLAuthProviderJsImpl .credentialFromResult (userCredential);
984
+ }
985
+
966
986
/// Phone number auth provider.
967
987
///
968
988
/// See: <https://firebase.google.com/docs/reference/js/firebase.auth.PhoneAuthProvider>.
Original file line number Diff line number Diff line change @@ -471,6 +471,14 @@ class PhoneAuthProviderJsImpl extends AuthProviderJsImpl {
471
471
);
472
472
}
473
473
474
+ @JS ('SAMLAuthProvider' )
475
+ class SAMLAuthProviderJsImpl extends AuthProviderJsImpl {
476
+ external factory SAMLAuthProviderJsImpl (String providerId);
477
+ external static OAuthCredential ? credentialFromResult (
478
+ UserCredentialJsImpl userCredential,
479
+ );
480
+ }
481
+
474
482
@JS ('ApplicationVerifier' )
475
483
abstract class ApplicationVerifierJsImpl {
476
484
external String get type;
Original file line number Diff line number Diff line change @@ -261,6 +261,10 @@ auth_interop.AuthProvider convertPlatformAuthProvider(
261
261
return oAuthProvider;
262
262
}
263
263
264
+ if (authProvider is SAMLAuthProvider ) {
265
+ return auth_interop.SAMLAuthProvider (authProvider.providerId);
266
+ }
267
+
264
268
throw FallThroughError ();
265
269
}
266
270
You can’t perform that action at this time.
0 commit comments