acquireToken method
Acquire a token interactively for the given scopes
return UserAdModel
contains user information but token and expiration date
Implementation
@override
Future<MsalUser?> acquireToken({required List<String> scopes}) async {
return _ErrorHandler.guard<MsalUser?>(() async {
assert(scopes.isNotEmpty, 'Scopes can not be empty');
final arguments = <String, dynamic>{'scopes': scopes};
final json = await methodChannel.invokeMethod('acquireToken', arguments);
if (json != null) {
return MsalUser.fromJson(jsonDecode(json));
}
return null;
});
}