'Construct a suitable value for WWW-Authenticate response header
If we have a request and a valid-looking path, the realm
is the account; otherwise we set it to \'unknown\'.'

def www_authenticate(self):

    try:
        (vrs, realm, rest) = self.request.split_path(2, 3, True)
        if (realm in ('v1.0', 'auth')):
            realm = 'unknown'
    except (AttributeError, ValueError):
        realm = 'unknown'
    return ('Swift    realm="%s"' % urllib.parse.quote(realm))
