Token authentication for nbdev_pypi

On the official nbdev_pypi tutorial, it’s shown how to configure twine for PyPI access using a username and password.
I have successfully been able to use the PyPI token-based authentication scheme with nbdev, using the username __token__ in ~/.pypirc:

username = __token__
password = pypi-AgEIcH...

This blog post goes in the detail on how to deal with pypi token authentication in twine: How to upload your package to the Python Package Index (PyPI) test server · Not sorry for the inconvenience