Does there exist a spell (or other method) that allows the magical divination of a character's patron deity? I'll accept official or third-party solutions.
A quick google search for
Reveals all spells in the Pathfinder SRD for both Paizo and third party publications that contain the word "deity".
The best match seems to be Reveal Heretic, which is a cleric 2, inquisitor 2, paladin 2 spell by Radiance House, published in Pact Magic Unbound, Vol. 1.
If the character is a cleric, then a DC 10 knowledge (religion) check can identify the deity based on her holy symbol if it's a common deity, and DC 20 for an obscure deity. It's not a spell or magical divination, and it only works on characters that choose to wear a holy symbol, but it's in the knowledge table.