Use the \Magento\Framework\HTTP\Authentication::getCredentials() method.
\Magento\Framework\HTTP\Authentication::getCredentials()