Class OAuth2SessionInfo

  • All Implemented Interfaces:
    SessionInfo
    Direct Known Subclasses:
    OpenIDConnectSessionInfo

    public class OAuth2SessionInfo
    extends Object
    implements SessionInfo
    OAuth2 Session Info Object used to determine if the access token expiry time has passed and to determine if a session is still active.
    • Field Detail

      • clock

        protected final Clock clock
        Clock used when comparing expire times.
      • expireTime

        protected final Long expireTime
        Time when the session is set to expire.
    • Constructor Detail

      • OAuth2SessionInfo

        protected OAuth2SessionInfo​(Clock clock,
                                    DataStore dataStore)
                             throws OAuthException
        Constructs a OAuth2SessionInfo object.
        Parameters:
        clock - clock.
        dataStore - data store implementation used to retrieve session information from.
        Throws:
        OAuthException - when there is an issue retrieving data from the data store.
    • Method Detail

      • isActive

        public boolean isActive()
        Description copied from interface: SessionInfo
        Returns the status of the auth server session.
        Specified by:
        isActive in interface SessionInfo
        Returns:
        true if the session is still valid; false otherwise.
      • getExpireTime

        public Long getExpireTime()
        Description copied from interface: SessionInfo
        Returns the expireTime of current auth token stored in the DataStore implementation.
        Specified by:
        getExpireTime in interface SessionInfo
        Returns:
        expire time of Auth token.