policyTriggerSilently static method
Run user flow silently using stored refresh token.
On successful complete, the stored access-token will be refreshed (if necessary) and stored in the sessionStorage or localStorage respectively as specified in the configuration file.
The subject
is used to specify the user to authenticate (it corresponds
to the
Returns a Future containing a tag String
. The tag can be used to
differentiate operations. In fact, every AzureB2C asynchronous operation
return a B2COperationResult in which the source tag
is indicated.
The result of the method call is returned asynchronously to any AzureB2CCallback registered to the B2COperationSource.POLICY_TRIGGER_SILENTLY topic.
Possible operation states are:
- B2COperationState.SUCCESS if successful,
- B2COperationState.CLIENT_ERROR if an error occurred,
- B2COperationState.USER_INTERACTION_REQUIRED if it the policy trigger cannot be completed without user intervention (e.g. refresh token expired).
- B2COperationState.SERVICE_ERROR if there is a configuration error with respect to the authority setting or if the authentication provider is down for some reasons.
Implementation
static Future<String> policyTriggerSilently(
String subject, String policyName, List<String> scopes) async {
var tag = GUIDGen.generate();
var args = {
"tag": tag,
"policyName": policyName,
"scopes": scopes,
"subject": subject
};
await _channel.invokeMethod('policyTriggerSilently', args);
return tag;
}