firebase_auth: SAMLAuthProvider throws an error with loginWithSSOProvider

Open
#17,009 6 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
dart, firebase, flutter

Research direction

Start with the reported stack-trace entries in firebase_auth_platform_interface/src/method_channel/utils/exception.dart at line 47 and src/method_channel/method_channel_firebase_auth.dart at line 405. Reproduce the SAMLAuthProvider sign-in on iOS and Android using the issue's example, then verify that successful sign-in no longer produces the reported type error and that the platform-specific result is handled correctly.

Written by the indexing model from the issue text.

Description

blocked: firebase-sdk Needs Attention platform: ios plugin: auth type: enhancement
Is there an existing issue for this?
  • I have searched the existing issues.
Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

When signInWithProvider is called with SAMLAuthProvider, the login seems successful but it throws an error like below:

loginWithSSOProvider error: type 'String' is not a subtype of type 'Map<dynamic, dynamic>?'

Reproducing the issue
final provider = SAMLAuthProvider('saml.mycompany.com');

UserCredential userCredential = await FirebaseAuth.instance.signInWithProvider(provider);
Firebase Core version

3.10.0

Flutter Version

3.22.3

Relevant Log Output
Error received from Flutter ["exceptionDescription": type 'String' is not a subtype of type 'Map<dynamic, dynamic>?'#0      platformExceptionToFirebaseAuthException (package:firebase_auth_platform_interface/src/method_channel/utils/exception.dart:47:25), "stackTraceDescription": #0      platformExceptionToFirebaseAuthException (package:firebase_auth_platform_interface/src/method_channel/utils/exception.dart:47:25)
#1      convertPlatformException (package:firebase_auth_platform_interface/src/method_channel/utils/exception.dart:26:5)
#2      MethodChannelFirebaseAuth.signInWithProvider (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:405:7)
<asynchronous suspension>
#3      FirebaseAuth.signInWithProvider (package:firebase_auth/src/firebase_auth.dart:641:9)
<asynchronous suspension>
]
Flutter dependencies
Expand Flutter dependencies snippet
Dart SDK 3.4.4
Flutter SDK 3.22.3

dependencies:
...
- firebase_auth: ^5.4.0
- firebase_core: ^3.10.0
...
Additional context and comments

Android also throws an error but it it different with iOS. The Android throws below error.

loginWithSSOProvider error: [firebase_auth/unknown] https://myproject.firebaseapp.com/__/auth/handler?providerId= saml.mycompany.com

Dominant language
Dart
Stars
9.3k
Forks
4.1k
Avg merge
2d 10h
Merged PRs (30d)
78

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/flutterfire

All issues in firebase/flutterfire

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.