getUserInfo static method

Future<Map<String, dynamic>> getUserInfo({
  1. required UserInfoRequest request,
})

Implementation

static Future<Map<String, dynamic>> getUserInfo(
    {required UserInfoRequest request}) async {
  try {
    final response = await httpRetry(
      () => http.get(
        Uri.parse(request.configuration.userInfoEndpoint),
        headers: {
          "Authorization": "${request.tokenType} ${request.accessToken}"
        },
      ),
    );

    if (response == null) throw UserInfoException(ERROR_INVALID_RESPONSE);

    return response;
  } on Exception catch (e) {
    throw UserInfoException(e.toString());
  }
}