authenticateUserImplicitly method

Future<UserProfile> authenticateUserImplicitly(
  1. List<String>? scopes
)

Implementation

Future<UserProfile> authenticateUserImplicitly(List<String>? scopes) async {
  try {
    var userProfile = await Onegini.instance.channel.invokeMethod(
        Constants.authenticateDevice, <String, dynamic>{'scope': scopes});

    return UserProfile.fromJson(json.decode(userProfile));
  } on TypeError catch (error) {
    throw PlatformException(
        code: Constants.wrapperTypeError.code.toString(),
        message: Constants.wrapperTypeError.message,
        stacktrace: error.stackTrace?.toString());
  }
}