Events/Auth/minified-auth

SaveEncryptedSessionEvent

Gets fired right after AuthManager finishes encrypting and saving a session to disk

Fields

SessionFilePath

The file the encrypted session was written to

Accessor: SessionFile()

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:

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();
});

Posted by

API reference: com.dervarex.minified.auth.events.encryption.SaveEncryptedSessionEvent