Add basic authentication of WordPress on any external PHP file?

Add basic authentication of WordPress on any external PHP file?

tech