MicrosoftAuthProvider class
This class should be used to either create a new Microsoft credential with an access code, or use the provider to trigger user authentication flows.
For example, on web based platforms pass the provider to a Firebase method
(such as signInWithPopup
):
var microsoftProvider = MicrosoftAuthProvider();
microsoftProvider.addScope('mail.read');
microsoftProvider.setCustomParameters({
'login_hint': 'user@firstadd.onmicrosoft.com',
});
FirebaseAuth.instance.signInWithPopup(microsoftProvider)
.then(...);
If authenticating with Microsoft via a 3rd party, use the returned
accessToken
to sign-in or link the user with the created credential, for
example:
String accessToken = '...'; // From 3rd party provider
var microsoftAuthCredential = MicrosoftAuthProvider.credential(accessToken);
FirebaseAuth.instance.signInWithCredential(microsoftAuthCredential)
.then(...);
- Inheritance
-
- Object
- AuthProvider
- MicrosoftAuthProvider
Constructors
- MicrosoftAuthProvider()
- Creates a new instance.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
parameters
→ Map<
String, String> -
Returns the parameters for this provider instance.
no setter
- providerId → String
-
The provider ID.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scopes
→ List<
String> -
Returns the currently assigned scopes to this provider instance.
no setter
Methods
-
addScope(
String scope) → MicrosoftAuthProvider - Adds Microsoft OAuth scope.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setCustomParameters(
Map< String, String> customOAuthParameters) → MicrosoftAuthProvider - Sets the OAuth custom parameters to pass in a Microsoft OAuth request for popup and redirect sign-in operations.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- MICROSOFT_SIGN_IN_METHOD → String
-
This corresponds to the sign-in method identifier.
no setter
- PROVIDER_ID → String
-
no setter
Static Methods
-
credential(
String accessToken) → OAuthCredential -
Create a new MicrosoftAuthCredential from a provided
accessToken
;