Do you want to whitelist only certain IPs, or do you have to check for username/IP combination? Because doing it in the firewall would be a lot easier in that case.
If you really want to hack the authentication subsystem, things can get complicated. Are you using the alfrescoNtlm authenticator? Implementing a new subsys from scratch is not easy, if you plan to cover HTTP, CIFS, WebDAV, Sharepoint etc.
Your fastest option in that case is probably to modify one of the existing authenticators or wrap them (delegate pattern).
Cheers,
Michael