File tree 1 file changed +9
-9
lines changed
packages/firebase_auth/firebase_auth_platform_interface/lib/src/providers
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -24,22 +24,22 @@ const _kProviderId = 'microsoft.com';
24
24
/// .then(...);
25
25
/// ```
26
26
///
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
31
30
/// ```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);
37
34
/// ```
38
35
class MicrosoftAuthProvider extends AuthProvider {
39
36
/// Creates a new instance.
40
37
MicrosoftAuthProvider () : super (_kProviderId);
41
38
42
39
/// 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
+ )
43
43
static OAuthCredential credential (String accessToken) {
44
44
return MicrosoftAuthCredential ._credential (
45
45
accessToken,
You can’t perform that action at this time.
0 commit comments