I’ll ask a bit of an extra question: why do you need to programatically login? Is it to create an access token, or start scaffolding extra info?
In v2, you cannot simply “login” - you (as a speckle app) need to request authorisation from the user to act on his behalf, and then you’ll get a token. There’s a difference as well between first party apps (pre-registered) and third-part apps (dynamically registered) - the scopes that are available to them are different (less in the case of the latter).
I suspect, (pending your answer of course - it might change things completely!) that this is pretty much backend-to-backend communication. If that’s the case, the simplest way might be to write some post-install scripts on your speckle server deployment to do what is needed (e.g., pre-register your server as an app, or even insert users, tokens, etc. in the database…).