Skip to main content

AuthN | C# SDK | Session Endpoints

Session Endpoints

Invalidate Session | Client

ClientSession.Invalidate(string, string)

Invalidate a session by session ID using a client token.

required parameters

string

A user token value

string

An ID for a token

Response Object

Task<Response<ClientSessionInvalidateResult>>

Response<ClientSessionInvalidateResult>

var response = await client.Client.Session.Invalidate(
    "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a", 
    "pmt_zppkzrjguxyblaia6itbiesejn7jejnr");

List sessions (client token)

ClientSession.List(ClientSessionListRequest)

List sessions using a client token.

required parameters

ClientSessionListRequest

ClientSessionListRequest

Response Object

Task<Response<ClientSessionListResult>>

Response<ClientSessionListResult>

var request = new ClientSessionListRequest
    .Builder("ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a")
    .Build();

var response = await client.Client.Session.List(request);

Log out (client token)

ClientSession.Logout(string)

Log out the current user's session.

required parameters

string

A user token value

Response Object

Task<Response<ClientSessionLogoutResult>>

Response<ClientSessionLogoutResult>

await client.Client.Session.Logout("ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a");

Refresh a Session

ClientSession.Refresh(ClientSessionRefreshRequest)

Refresh a session token.

required parameters

ClientSessionRefreshRequest

ClientSessionRefreshRequest

Response Object

Task<Response<ClientSessionRefreshResult>>

Response<ClientSessionRefreshResult>

var request = new ClientSessionRefreshRequest.Builder(
    "ptr_xpkhwpnz2cmegsws737xbsqnmnuwtbm5")
.WithUserToken("ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a")
.Build();

var response = await client.Client.Session.Refresh(request);

Invalidate Session

Session.Invalidate(string)

Invalidate a session by session ID.

required parameters

string

An ID for a token

Response Object

Task<Response<SessionInvalidateResult>>

Response<SessionInvalidateResult>

await client.Session.Invalidate("pmt_zppkzrjguxyblaia6itbiesejn7jejnr");

List session (service token)

Session.List(SessionListRequest)

List sessions.

required parameters

SessionListRequest

Response Object

Task<Response<SessionListResult>>

Response<SessionListResult>

var request = new SessionListRequest.Builder().Build();

var response = await client.Session.List(request);

Log out (service token)

Session.Logout(string)

Invalidate all sessions belonging to a user.

required parameters

string

The identity of a user or a service

Response Object

Task<Response<SessionLogoutResult>>

Response<SessionLogoutResult>

await client.Session.Logout("pui_xpkhwpnz2cmegsws737xbsqnmnuwtvm5");