Class SessionApi

java.lang.Object
com.okta.sdk.resource.api.SessionApi

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-09-23T16:19:57.008753975Z[Etc/UTC]", comments="Generator version: 7.8.0") public class SessionApi extends Object
  • Constructor Details

    • SessionApi

      public SessionApi()
    • SessionApi

      public SessionApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • closeCurrentSession

      public void closeCurrentSession(String cookie) throws ApiException
      Close the current Session Closes the Session for the user who is currently signed in. Use this method in a browser-based application to sign out a user. > **Note:** This operation requires a session cookie for the user. An API token isn't allowed for this operation.
      Parameters:
      cookie - (optional)
      Throws:
      ApiException - if fails to make API call
    • closeCurrentSession

      public void closeCurrentSession(String cookie, Map<String,String> additionalHeaders) throws ApiException
      Close the current Session Closes the Session for the user who is currently signed in. Use this method in a browser-based application to sign out a user. > **Note:** This operation requires a session cookie for the user. An API token isn't allowed for this operation.
      Parameters:
      cookie - (optional)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • createSession

      public Session createSession(CreateSessionRequest createSessionRequest) throws ApiException
      Create a Session with session token Creates a new Session for a user with a valid session token. Use this API if, for example, you want to set the session cookie yourself instead of allowing Okta to set it, or want to hold the session ID to delete a session through the API instead of visiting the logout URL.
      Parameters:
      createSessionRequest - (required)
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • createSession

      public Session createSession(CreateSessionRequest createSessionRequest, Map<String,String> additionalHeaders) throws ApiException
      Create a Session with session token Creates a new Session for a user with a valid session token. Use this API if, for example, you want to set the session cookie yourself instead of allowing Okta to set it, or want to hold the session ID to delete a session through the API instead of visiting the logout URL.
      Parameters:
      createSessionRequest - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • getCurrentSession

      public Session getCurrentSession(String cookie) throws ApiException
      Retrieve the current Session Retrieves Session information for the current user. Use this method in a browser-based application to determine if the user is signed in. > **Note:** This operation requires a session cookie for the user. An API token isn't allowed for this operation.
      Parameters:
      cookie - (optional)
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • getCurrentSession

      public Session getCurrentSession(String cookie, Map<String,String> additionalHeaders) throws ApiException
      Retrieve the current Session Retrieves Session information for the current user. Use this method in a browser-based application to determine if the user is signed in. > **Note:** This operation requires a session cookie for the user. An API token isn't allowed for this operation.
      Parameters:
      cookie - (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • getSession

      public Session getSession(String sessionId) throws ApiException
      Retrieve a Session Retrieves information about the Session specified by the given session ID
      Parameters:
      sessionId - `id` of the Session (required)
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • getSession

      public Session getSession(String sessionId, Map<String,String> additionalHeaders) throws ApiException
      Retrieve a Session Retrieves information about the Session specified by the given session ID
      Parameters:
      sessionId - `id` of the Session (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • refreshCurrentSession

      public Session refreshCurrentSession(String cookie) throws ApiException
      Refresh the current Session Refreshes the Session for the current user > **Note:** This operation requires a session cookie for the user. An API token isn't allowed for this operation.
      Parameters:
      cookie - (optional)
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • refreshCurrentSession

      public Session refreshCurrentSession(String cookie, Map<String,String> additionalHeaders) throws ApiException
      Refresh the current Session Refreshes the Session for the current user > **Note:** This operation requires a session cookie for the user. An API token isn't allowed for this operation.
      Parameters:
      cookie - (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • refreshSession

      public Session refreshSession(String sessionId) throws ApiException
      Refresh a Session Refreshes an existing Session using the `id` for that Session. A successful response contains the refreshed Session with an updated `expiresAt` timestamp.
      Parameters:
      sessionId - `id` of the Session (required)
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • refreshSession

      public Session refreshSession(String sessionId, Map<String,String> additionalHeaders) throws ApiException
      Refresh a Session Refreshes an existing Session using the `id` for that Session. A successful response contains the refreshed Session with an updated `expiresAt` timestamp.
      Parameters:
      sessionId - `id` of the Session (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Session
      Throws:
      ApiException - if fails to make API call
    • revokeSession

      public void revokeSession(String sessionId) throws ApiException
      Revoke a Session Revokes the specified Session
      Parameters:
      sessionId - `id` of the Session (required)
      Throws:
      ApiException - if fails to make API call
    • revokeSession

      public void revokeSession(String sessionId, Map<String,String> additionalHeaders) throws ApiException
      Revoke a Session Revokes the specified Session
      Parameters:
      sessionId - `id` of the Session (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getObjectMapper

      protected static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()