Solution:
First she asks the three people, "Are you a spy?" The truth-teller will say "no," the liar will say "yes," and the spy could say either. Either way, two people will give the same answer and the third will give a different answer. She can now tell the identity of that third person: if they said "yes" and the other two said "no," they must be the truth-teller, and if they said "no" and the other two said "yes," they must be the liar.
Now she picks one of the people she does not yet know the identity of (call this person A), and asks the three people whether that person is a spy. The answer of the person whose identity she knows (call this person B) will then tell her whether or not A is a spy. If B is a truth-teller, then A is a spy if and only if B says "yes," and if B is a liar, then A is a spy if and only if B says "no." Either way, she now knows what B is, and that tells her what the third person must be.