This should be fairly easy to provide via API, similar to how this feature is available in the clientarea in the manage service page. It would be useful to provide an external login option and avoid using the user / password of the service for automatic login.
I have thought of everything possible to do this without accessing database or resetting service password, however it is just not possible.
The ModuleCustom API is probably what could be used as a base, but from what I understood, the ModuleCustom only accepts returns a string back from the function called.
Anyway, I hope this can be added in the "Service" API group something like ModuleSingleSignOn or something of the like.