Interface ISessionsClient
A client that works with Okta Session resources.
Namespace: Okta.Sdk
Assembly: Okta.Sdk.dll
Syntax
public interface ISessionsClient
Methods
CreateSessionAsync(ICreateSessionRequest, CancellationToken)
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 in order to delete a session via the API instead of visiting the logout URL.
Declaration
Task<ISession> CreateSessionAsync(ICreateSessionRequest createSessionRequest, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| ICreateSessionRequest | createSessionRequest | The ICreateSessionRequest resource. |
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ISession> | The ISession response. |
EndSessionAsync(String, CancellationToken)
Declaration
Task EndSessionAsync(string sessionId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | sessionId | |
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A Task that represents the asynchronous operation. |
GetSessionAsync(String, CancellationToken)
Get details about a session.
Declaration
Task<ISession> GetSessionAsync(string sessionId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | sessionId | |
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ISession> | The ISession response. |
RefreshSessionAsync(String, CancellationToken)
Declaration
Task<ISession> RefreshSessionAsync(string sessionId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | sessionId | |
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ISession> | The ISession response. |