Let $\mathbb{F}$ be a finite field. Let $a_1,\dots,a_n \in \mathbb{F}$ be given. I want to know whether there exists $x_1,\dots,x_n \in \mathbb{F}$ such that
$$a_1 x_1^2 + a_2 x_2^2 + \dots + a_n x_n^2 = 1.$$
My question: Can we characterize when this equation has a solution, i.e., by some criterion on $a_1,\dots,a_n$? Is there a clean characterization, in terms of $a_1,\dots,a_n$ and the properties of $\mathbb{F}$?
Here's what I can see immediately. First, if $n=1$, there is an easy answer (the equation has a solution iff $a_1$ is a square in $\mathbb{F}$). Second, if any $a_i$ is a square in $\mathbb{F}$, the equation has a solution (set all other $x_j$'s to $0$), so we can assume that all the $a_i$'s are non-squares and that $n \ge 2$. Third, if $-1$ is a square in $\mathbb{F}$, then the equation has a solution: we can take $x_2 = \sqrt{-a_1/a_2} \cdot x_1$. But what about the case where $-1$ is a non-square in $\mathbb{F}$? Is it always guaranteed to have a solution in this case?