You can use mod_setenvif
in conjunction with mod_auth
.
SetEnvIf Remote_Addr ^12\.345\.67\.78$ ALLOWED
AuthType Basic
AuthName "My Protected Area"
AuthUserFile /full/path/to/passwords
Require valid-user
Satisfy any
Order deny,allow
Deny from all
Allow from env=ALLOWED