Skip to content

Commit 872bb18

Browse files
fix(auth): deprecate Microsoft provider method not used for authentication
1 parent b1bd93f commit 872bb18

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: packages/firebase_auth/firebase_auth_platform_interface/lib/src/providers/microsoft_auth.dart

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ const _kProviderId = 'microsoft.com';
2424
/// .then(...);
2525
/// ```
2626
///
27-
/// If authenticating with Microsoft via a 3rd party, use the returned
28-
/// `accessToken` to sign-in or link the user with the created credential, for
29-
/// example:
30-
///
27+
/// For native apps, you may also sign-in with [signInWithProvider]. Ensure you have
28+
/// an app configured in the Microsoft Azure portal.
29+
/// See Firebase documentation for more information: https://firebase.google.com/docs/auth/flutter/federated-auth?#microsoft
3130
/// ```dart
32-
/// String accessToken = '...'; // From 3rd party provider
33-
/// var microsoftAuthCredential = MicrosoftAuthProvider.credential(accessToken);
34-
///
35-
/// FirebaseAuth.instance.signInWithCredential(microsoftAuthCredential)
36-
/// .then(...);
31+
/// MicrosoftAuthProvider microsoftProvider = MicrosoftAuthProvider();
32+
/// microsoftProvider.setCustomParameters({'tenant': 'TENANT ID FROM AZURE PORTAL'},);
33+
/// await FirebaseAuth.instance.signInWithProvider(microsoftProvider);
3734
/// ```
3835
class MicrosoftAuthProvider extends AuthProvider {
3936
/// Creates a new instance.
4037
MicrosoftAuthProvider() : super(_kProviderId);
4138

4239
/// Create a new [MicrosoftAuthCredential] from a provided [accessToken];
40+
@Deprecated(
41+
'`credential()` has been deprecated. Sign-in cannot be directly achieved with OAuth access token based credentials for Microsoft',
42+
)
4343
static OAuthCredential credential(String accessToken) {
4444
return MicrosoftAuthCredential._credential(
4545
accessToken,

0 commit comments

Comments
 (0)