That capability is automatically provided by the
J2EE standard container login mechanism, which, when presented with a secured URL for a non-authenticated user initiates a login process at the server level, and only if the user logs in successfully transparently resumes the original request.
Spring security does have the ability to work in concert with this mechanism, although I have no specific details on this, as I usually don't need the extra protections of Spring Security myself. I have seen products that did, however.