If you don't want to use polynomial long division, you can factor $x^2+2x-3$ by seeing it has roots at $1$ and $-3$, Then, you need to add a degree 1 polynomial to your polynomial such that the sum is divisible by $x-1$ and $x+3$. Those are relatively prime, so the sum will then be divisible by the product, which is $x^2+2x-3$. So,
$$
\begin{aligned}
x^2 + 2x -3 &\mid x^4+2x^3−2x^2+x−1+ax+b\ \mbox{if}\\
(x-1)(x+3) &\mid x^4+2x^3−2x^2+x−1+ax+b\\
P(1) &= P(-3) = 0\ \mbox{where}\\
P(x) &= x^4+2x^3−2x^2+x−1+ax+b\\
P(1) &= a + b + 1 = 0,\\
P(-3) &= -3a + b + 5 = 0\\
a + b &= -1\\
-3a + b &= -5\\
a&=1\\
b&=-2
\end{aligned}
$$
Added
The poster asked why I needed a degree $1$ polynomial. Remember that integers have this property: when I divide integer $a$ by integer $b$, I get an equation:
$$
a = bq + r,\quad 0\le r < |b|.
$$
The absolute value is what we call a Euclidean norm, and division has the remainder have its norm smaller than the dividend. The integers $\mathbb{Z}$ are called a Euclidean ring.
Polynomials are also a Euclidean ring, where the norm is just the degree:
$$
a(x) = b(x)q(x) + r(x),\quad 0\le \deg r < \deg b.
$$
So, if you had found an arbitrary solution $p(x)$ to your problem, then you could divide $p$ by $x^2+2x-3$ and get a remainder of degree less than $2$, and that would be unique. So, use $ax+b$ so you have only two integers to find.