If you're looking for an out of the box solution Cloudseal could be a good option as it includes single sign on, user management and two factor authentication. There is a dedicated Spring client available for the platform
N.B. I work for Cloudseal so I'm biased!