Interface Sessions

  • All Implemented Interfaces:

    
    public interface Sessions
    
                        

    The Sessions interface provides methods for authenticating, updating, or revoking sessions, and properties to retrieve the existing session token (opaque or JWT).

    • Constructor Detail

    • Method Detail

      • getSync

         abstract SessionData getSync()

        Get the locally persisted session

      • authenticate

         abstract StytchResult<IAuthData> authenticate(Sessions.AuthParams authParams)

        Authenticates a Session and updates its lifetime by the specified session_duration_minutes. If the session_duration_minutes is not specified, a Session will not be extended

        Parameters:
        authParams - required to authenticate
        Returns:

        AuthResponse

      • authenticate

         abstract Unit authenticate(Sessions.AuthParams authParams, Function1<StytchResult<IAuthData>, Unit> callback)

        Authenticates a Session and updates its lifetime by the specified session_duration_minutes. If the session_duration_minutes is not specified, a Session will not be extended

        Parameters:
        authParams - required to authenticate
        callback - a callback that receives an AuthResponse
      • authenticateCompletable

         abstract CompletableFuture<StytchResult<IAuthData>> authenticateCompletable(Sessions.AuthParams authParams)

        Authenticates a Session and updates its lifetime by the specified session_duration_minutes. If the session_duration_minutes is not specified, a Session will not be extended

        Parameters:
        authParams - required to authenticate
        Returns:

        AuthResponse

      • revoke

         abstract StytchResult<BasicData> revoke(Sessions.RevokeParams params)

        Revoke a Session and immediately invalidate all its tokens.

        Parameters:
        params - required for revoking a session
        Returns:

        BaseResponse

      • revoke

         abstract Unit revoke(Sessions.RevokeParams params, Function1<StytchResult<BasicData>, Unit> callback)

        Revoke a Session and immediately invalidate all its tokens.

        Parameters:
        params - required for revoking a session
        callback - a callback that receives a BaseResponse
      • updateSession

         abstract Unit updateSession(String sessionToken, String sessionJwt)

        Updates the current session with a sessionToken and sessionJwt