Passing login details back and forth between Plone and Sanic (app)

I have my code for 'take screenshot' Sanic puppeteer app (Taking a screenshot of all pages ) still 'lying around' and was thinking maybe it is time to 'do something with it'.

Today, I tried it on a server, so if one goes to http://xweb14d.plana.dk:5009/login ( medialog / takeThatScreenshot ) it is possible to get a screenshot by visiting an url like: http://xweb14d.plana.dk:5009/screenshot/https://www.plone.org ( screenshot of 'everything on the site' will also be possible, which I did for: fender — Grieg Medialog Tags)

If I get the time, it would be nice to be able to take screenshots 'as a logged in user'. This would probably require Plone to 'login to Sanic and Sanic log in to Plone again. To me, it looks like I then have to store both logins (passwords) in Plone (control panel (?) ), pass them both to Sanic and let Sanic Pyppeteer app login on the Plone site.

How can I achieve this in a safe way? Both the 'storing' and the 'sending' ?