How to access state value with Java SDK

I’m using the Java SDK (mvc-auth-commons 1.4.0) with Java 11.0.9.

The documentation suggests using the state of the login request to be able to match it on the callback to perform deep linking. I’m trying to do this, but I can’t find anyway in the SDK to get the state. It doesn’t appear to be in the returned token, and AuthenticationController only returns the Tokens. Am I missing something?

Looking in the source I can see how it is encoded and stored in a cookie, but that’s very hackish.Is there no offical way to do this?