We demonstrate in situ characterization of a spatially varying polarization state of an optical field at the focus of a scanning third-harmonic generation (THG) optical microscope. Polarization projections are measured by forming THG images of a polystyrene microsphere scanned through the focused beam and combined in a noniterative phase-retrieval algorithm. Controlled spatially varying polarization states are introduced by imaging spatially inhomogeneous polarization distributions constructed with reflective spatial light modulator to the focal plane of a microscope objective.