Update auth.py

In case the string contains unicode characters (e.g. emoji text=u'monkey \U0001F435'.encode('utf-8')), str() operation fails.