using rpccookiefile instead of username and password for antminers
The RPC cookie file is only for local authentication of bitcoin-cli.

For external applications, you should use rpcauth= lines in bitcoin.conf. A tool for generating these lines given a username and password is in the repository.