Get light position in shader for 2D lightning
If you want the location of the light in World space, you can do it with drivers:

That's the disconnected Combine XYZ node labelled 'Light Location'  in the illustration. Pin the material's node editor open for convenience, right-click each of the X, Y and Z fields in the light's Transform &gt; Location panel, select Copy as New Driver, and right-click &gt; Paste Driver in the XYZ fields.
You can also do it without drivers, by adding/subtracting the coordinates of the shading-point in various texture-spaces. However, you probably don't want the light's location in rotated spaces.. the only way I can think of getting round that is to associate an un-rotated target Empty with the objects of interest. I've called them 'Locators'. They have Copy Location constraints on their objects, but don't rotate with them.

Then the Yellow Vector Math node in the illustration gives the Light's location with respect to the cube's location, and the Turquoise one gives the Light's location in World Space.
Drivers are probably the way to go, otherwise it's more fiddly to reproduce the material for different objects.