Class UserSession

java.lang.Object
com.caplin.server.auth.UserSession

public class UserSession extends Object

Represents a user's session on the liberator

A UserSession instance contains an AuthenticationUser and information about the session and its connection details.

  • Method Details

    • getApplicationId

      public String getApplicationId()

      The application identifier provided by the client.

      This information can be used for application-specific authentication.

      Returns:
      the application identifier provided by the client attempting login
    • getIpAddress

      public String getIpAddress()

      The source ip address of the client's host.

      This information can be used for location-based permissioning or blocking specific ip-address ranges. Also can be useful when ejecting sessions using the SessionManager

      N.B. This ip address may be a proxy or gateway rather than the client's true ip address

      Returns:
      the source ip address of the session's connection
    • getMachineId

      public String getMachineId()

      The machine identifier provided by the client.

      This information can be used for machine-specific permissioning. Can also be useful when ejecting sessions using the SessionManager

      Returns:
      the machine identifier provided by the client attempting login
    • getConnectionTime

      public Date getConnectionTime()
      The time at which the session was connected.
      Returns:
      the time at which the session was connected.
    • getSessionId

      public String getSessionId()

      The unique session identifier for this session.

      These session identifiers are unique per session present in the liberator.

      Returns:
      the unique session identifier allocated by the liberator for this user session
    • getUser

      public AuthenticationUser getUser()

      The user of this session.

      Returns:
      the authentication user associated with this session
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object