def make_secure_token(*args, **options):
    key = options.get('key')
    key = _secret_key(key)

    l = [s if isinstance(s, bytes) else s.encode('utf-8') for s in args]

    payload = b'\0'.join(l)

    token_value = hmac.new(key, payload, sha512).hexdigest()

    if hasattr(token_value, 'decode'):  # pragma: no cover
        token_value = token_value.decode('utf-8')  # ensure bytes

    return token_value
This will create a secure token that you can use as an authentication
dataset/ETHPy150Open maxcountryman/flask-login/flask_login/utils.py/make_secure_token