  We develop a general microscopic theory of dc Josephson effect in hybrid SNS
structures with ballistic electrodes and spin-active NS interfaces. We
establish a direct relation between the spectrum of Andreev levels and the
Josephson current which contains complete information about non-trivial
interplay between Andreev reflection and spin-dependent interface scattering.
The system exhibits a rich structure of properties sensitive to spin-dependent
barrier transmissions, spin-mixing angles, relative magnetization orientation
of interfaces and the kinematic phase of scattered electrons. We analyze the
current-phase relations and identify the conditions for the presence of a
pi-junction state in the systems under consideration. We also analyze resonant
enhancement of the supercurrent in gate-voltage-driven nanojunctions. As
compared to the non-magnetic case, this effect can be strongly modified by
spin-dependent scattering at NS interfaces.
