policyTriggerInteractive static method
Runs user flow interactively.
On complete, access, refresh and id tokens are stored correctly according to the platform-specific implementation. And it is possible to retrive the access token or user information (id-token) via the provided methods.
The policyName
permits to select which authority (user-flow) trigger
from the ones specified in the configuration file. It must be indicated
just the name of the policy without the host and tenat part. It is
possible to indicate user's scopes
for the request (i.e it is also
possible to indicate default scopes in the configuration file that can be
then accessed from B2CConfiguration.defaultScopes). A loginHint
may be
passed to directly fill the email/username/phone-number field in the
policy flow.
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_INTERACTIVE topic.
Possible operation states are:
- B2COperationState.SUCCESS if policy trigger is successful.
- B2COperationState.CLIENT_ERROR if an error occurred,
- B2COperationState.PASSWORD_RESET if user requested a password reset,
- B2COperationState.USER_CANCELLED_OPERATION if the user cancelled the operation,
- 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.
See also:
Implementation
static Future<String> policyTriggerInteractive(
String policyName, List<String> scopes, String? loginHint) async {
var tag = GUIDGen.generate();
var args = {
"tag": tag,
"policyName": policyName,
"scopes": scopes,
"loginHint": loginHint
};
await _channel.invokeMethod('policyTriggerInteractive', args);
return tag;
}