Use www-authenticate to parse www-authenticate headers and generate authorization.