In ArcGIS Online, the scheduler for notebooks is really handy, and if one uses gis = GIS('home') to authenticate then the notebook runs well as the 'current user'.
My use case though is I need an AGOL notebook that switches between accounts (first running code in the core account and then in the linked community account). I don't want to save passwords in the code.
The options give in https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html seem to either require the password to be hard coded in the script, or use approaches (like profiles) that don't seem appropriate for ArcGIS Online. There are a number of documented authentication approaches, but it isn't clear which is best for AGOL (https://developers.arcgis.com/python/latest/guide/working-with-different-authentication-schemes/).
Profiles would be good approach, but I don't seem to be able to get this working in AGOL. I get error "NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details." I assume keyrings are not possible in AGOL.
What strategies are there for authenticating for unattended notebook runs? Many thanks...