by Matthew Terentjevs.
I believe this module - https://github.com/catalyst/moodle-auth_userkey can help with this. It creates an endpoint to generate a one-time URL user can be redirected to create a session.