How to fetchurl with credentials

I have enterprise version of Bitbucket which provides tokens for individual repositories. Will either the NIX_CURL_FLAGS or access-tokens methods support that?