Class SessionsClient
A client that communicates with the Okta management API.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Okta.Sdk
Assembly: Okta.Sdk.dll
Syntax
public sealed class SessionsClient : OktaClient, IOktaClient, 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
public 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
public 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
public 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
public 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. |