ArcGIS Online does not prompt for credentials when adding a web map service (WMS) secured with basic authentication. The request to the service fails with the error,"401: Full authentication required to access this resource."
Duplicate of ENH-000118381: The example provided in this defect is secured at the layer level, not the service level. This is by design and an ENH has been logged requesting this behavior be modified (ENH-000118381). The failure in this case is not due to basic authentication.
解决办法
Use Internet Explorer.
Make a GetMap request to the service in another browser tab, enter credentials, and then add the service to the map.