Convert auth to str so that it can be hashed

def _authstr(self, auth):
        """Convert auth to str so that it can be hashed"""
        if type(auth) is dict:
            return '{' + ','.join(["{0}:{1}".format(k, auth[k]) for k in sorted(auth.keys())]) + '}'
        return auth