async def get_credentials(self, image, tag):
        """
        Get the registry credentials for the given image and tag if supported
        by the remote helper, otherwise returns None

        Returns a dictionary of login fields.
        """
        token_url = f"/token/{image}:{tag}"
        self.log.debug(f"Getting registry token: {token_url}")
        token_json = None
        try:
            token_json = await self._request(token_url, method="POST", body="")
        except httpclient.HTTPError as e:
            if e.code == 404:
                return None
            raise
        self.log.debug(f"Token: {*token_json.keys(),}")
        token = {
            k: v
            for (k, v) in token_json.items()
            if k in ["username", "password", "registry"]
        }
        return token

        Get the registry credentials for the given image and tag if supported
        by the remote helper, otherwise returns None

        Returns a dictionary of login fields.
        
binderhub/registry.py