Even though you have saved your username and password to the Keychain on your Apple Macintosh computer, whenever you attempt to connect to a network share you are still prompted to connect.
The above action was added to macOS Sierra (10.12) and above. This action has been classed as a “security feature” by Apple as it “helps you to avoid transmitting login credentials to a server you didn’t intent to connect to”.
While Apple recommend that you should leave this feature enabled. To disable this security feature you need to do the following:
sudo defaults write /Library/Preferences/com.apple.NetworkAuthorization AllowUnknownServers -bool YES
sudo defaults delete write /Library/Preferences/com.apple.NetworkAuthorization AllowUnknownServers