Events/Auth/minified-auth
SaveEncryptedSessionEvent
Gets fired right after AuthManager finishes encrypting and saving a session to disk
Fields
SessionFilePathThe file the encrypted session was written to
When it fires
Encryptor.saveEncryptedSession(...) is called from AuthManager.persistSession(...), which runs after every successful login or session refresh, not just the first one. Concretely, this event fires after:
- a fresh device-code login completes (
AuthManager.login()orstartDeviceCodeLoginAsync()), and - a saved session is successfully refreshed via
AuthManager.loginWithSavedSession()(Minecraft/Xbox tokens are re-persisted even if only the access token changed).
The session content itself (the raw Microsoft/Xbox/Minecraft auth chain as JSON) is AES-encrypted with the master key from CreateMasterKeyEvent before being base64-encoded and written to SessionFile. This event fires after that write completes, so by the time you receive it the file on disk is already up to date.
Posted to the EventBus passed to AuthManager.init(baseDir, eventBus) - see the Events introduction for how this bus relates to LaunchConfiguration's.
Listening
Subscribe on the EventBus the event is posted to, see Events for which bus that is.
eventBus.subscribe(SaveEncryptedSessionEvent.class, event -> {
Path SessionFile = event.SessionFile();
});eventBus.subscribe(SaveEncryptedSessionEvent::class.java) { event ->
val SessionFile = event.SessionFile()
}Posted by
API reference: com.dervarex.minified.auth.events.encryption.SaveEncryptedSessionEvent