Class User
Represents a User resource in the Okta API.
Inheritance
System.Object
User
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()
Assembly: Okta.Sdk.dll
Syntax
public sealed class User : Resource, IUser, IResource
Properties
Activated
Declaration
public DateTimeOffset? Activated { get; }
Property Value
Type |
Description |
System.Nullable<System.DateTimeOffset> |
|
AppLinks
Gets a collection of IAppLink that can be enumerated asynchronously
Declaration
public IAsyncEnumerable<IAppLink> AppLinks { get; }
Property Value
Type |
Description |
System.Collections.Generic.IAsyncEnumerable<IAppLink> |
|
Created
Declaration
public DateTimeOffset? Created { get; }
Property Value
Type |
Description |
System.Nullable<System.DateTimeOffset> |
|
Credentials
Declaration
public IUserCredentials Credentials { get; set; }
Property Value
Factors
Gets a collection of IUserFactor that can be enumerated asynchronously
Declaration
public IAsyncEnumerable<IUserFactor> Factors { get; }
Property Value
Type |
Description |
System.Collections.Generic.IAsyncEnumerable<IUserFactor> |
|
Groups
Gets a collection of IGroup that can be enumerated asynchronously
Declaration
public IAsyncEnumerable<IGroup> Groups { get; }
Property Value
Type |
Description |
System.Collections.Generic.IAsyncEnumerable<IGroup> |
|
Id
Declaration
public string Id { get; }
Property Value
Type |
Description |
System.String |
|
LastLogin
Declaration
public DateTimeOffset? LastLogin { get; }
Property Value
Type |
Description |
System.Nullable<System.DateTimeOffset> |
|
LastUpdated
Declaration
public DateTimeOffset? LastUpdated { get; }
Property Value
Type |
Description |
System.Nullable<System.DateTimeOffset> |
|
PasswordChanged
Declaration
public DateTimeOffset? PasswordChanged { get; }
Property Value
Type |
Description |
System.Nullable<System.DateTimeOffset> |
|
Profile
Declaration
public IUserProfile Profile { get; set; }
Property Value
Roles
Gets a collection of IRole that can be enumerated asynchronously
Declaration
public IAsyncEnumerable<IRole> Roles { get; }
Property Value
Type |
Description |
System.Collections.Generic.IAsyncEnumerable<IRole> |
|
Status
Declaration
public UserStatus Status { get; }
Property Value
StatusChanged
Declaration
public DateTimeOffset? StatusChanged { get; }
Property Value
Type |
Description |
System.Nullable<System.DateTimeOffset> |
|
TransitioningToStatus
Declaration
public UserStatus TransitioningToStatus { get; }
Property Value
Type
Declaration
public IUserType Type { get; set; }
Property Value
Methods
ActivateAsync(Nullable<Boolean>, CancellationToken)
Declaration
public Task<IUserActivationToken> ActivateAsync(bool? sendEmail, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Nullable<System.Boolean> |
sendEmail |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
AddAllAppsAsTargetAsync(String, CancellationToken)
Declaration
public Task AddAllAppsAsTargetAsync(string roleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
roleId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
AddFactorAsync(AddCallFactorOptions, CancellationToken)
Adds a call factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddCallFactorOptions callFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddCallFactorOptions |
callFactorOptions |
The call factor options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddCustomHotpFactorOptions, CancellationToken)
Adds a token:hotp factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddCustomHotpFactorOptions hotpFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddCustomHotpFactorOptions |
hotpFactorOptions |
The token:hotp options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddEmailFactorOptions, CancellationToken)
Adds an email factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddEmailFactorOptions emailFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddEmailFactorOptions |
emailFactorOptions |
The email factor options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddHardwareFactorOptions, CancellationToken)
Adds a hardware factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddHardwareFactorOptions hardwareFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddHardwareFactorOptions |
hardwareFactorOptions |
The hardware factor options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddPushFactorOptions, CancellationToken)
Adds a push factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddPushFactorOptions pushFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddPushFactorOptions |
pushFactorOptions |
The push factor options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddSecurityQuestionFactorOptions, CancellationToken)
Adds a security question factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddSecurityQuestionFactorOptions securityQuestionFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddSecurityQuestionFactorOptions |
securityQuestionFactorOptions |
The security question options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddSmsFactorOptions, CancellationToken)
Adds an SMS factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddSmsFactorOptions smsFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddSmsFactorOptions |
smsFactorOptions |
The SMS factor options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddTokenFactorOptions, CancellationToken)
Adds a token factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddTokenFactorOptions tokenFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddTokenFactorOptions |
tokenFactorOptions |
The token factor options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddFactorAsync(AddTotpFactorOptions, CancellationToken)
Adds a token:software:totp factor to the user
Declaration
public Task<IUserFactor> AddFactorAsync(AddTotpFactorOptions totpFactorOptions, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
AddTotpFactorOptions |
totpFactorOptions |
The token:software:totp options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
AddGroupTargetAsync(String, String, CancellationToken)
Declaration
public Task AddGroupTargetAsync(string roleId, string groupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
roleId |
|
System.String |
groupId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
AddToGroupAsync(String, CancellationToken)
Declaration
public Task AddToGroupAsync(string groupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
groupId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
AssignRoleAsync(IAssignRoleRequest, String, CancellationToken)
Declaration
public Task<IRole> AssignRoleAsync(IAssignRoleRequest assignRoleRequest, string disableNotifications = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
IAssignRoleRequest |
assignRoleRequest |
|
System.String |
disableNotifications |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IRole> |
|
ChangePasswordAsync(ChangePasswordOptions, CancellationToken)
Changes the user password
Declaration
public Task<IUserCredentials> ChangePasswordAsync(ChangePasswordOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
ChangePasswordOptions |
options |
The password options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
ChangeRecoveryQuestionAsync(ChangeRecoveryQuestionOptions, CancellationToken)
Changes the user recovery question
Declaration
public Task ChangeRecoveryQuestionAsync(ChangeRecoveryQuestionOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
ChangeRecoveryQuestionOptions |
options |
The recovery question options
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
The asynchronous task
|
ClearSessionsAsync(Nullable<Boolean>, CancellationToken)
Declaration
public Task ClearSessionsAsync(bool? oauthTokens, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Nullable<System.Boolean> |
oauthTokens |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DeactivateAsync()
Declaration
public Task DeactivateAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
The asynchronous task
|
DeactivateAsync(Nullable<Boolean>, CancellationToken)
Declaration
public Task DeactivateAsync(bool? sendEmail, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Nullable<System.Boolean> |
sendEmail |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DeactivateAsync(CancellationToken)
Declaration
public Task DeactivateAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
The asynchronous task
|
DeactivateOrDeleteAsync(Nullable<Boolean>, CancellationToken)
Deletes a deactivated user
Declaration
public Task DeactivateOrDeleteAsync(bool? sendEmail, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Nullable<System.Boolean> |
sendEmail |
The send email flag
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
The asynchronous task
|
DeleteFactorAsync(String, CancellationToken)
Declaration
public Task DeleteFactorAsync(string factorId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
factorId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
EnrollFactorAsync(IUserFactor, Nullable<Boolean>, String, Nullable<Int32>, Nullable<Boolean>, CancellationToken)
Declaration
public Task<IUserFactor> EnrollFactorAsync(IUserFactor body, bool? updatePhone, string templateId = null, int? tokenLifetimeSeconds, bool? activate, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
IUserFactor |
body |
|
System.Nullable<System.Boolean> |
updatePhone |
|
System.String |
templateId |
|
System.Nullable<System.Int32> |
tokenLifetimeSeconds |
|
System.Nullable<System.Boolean> |
activate |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IUserFactor> |
|
ExpirePasswordAndGetTemporaryPasswordAsync(CancellationToken)
Declaration
public Task<ITempPassword> ExpirePasswordAndGetTemporaryPasswordAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
ExpirePasswordAsync(CancellationToken)
Declaration
public Task<IUser> ExpirePasswordAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IUser> |
|
ForgotPasswordGenerateOneTimeTokenAsync(Nullable<Boolean>, CancellationToken)
Declaration
public Task<IForgotPasswordResponse> ForgotPasswordGenerateOneTimeTokenAsync(bool? sendEmail, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Nullable<System.Boolean> |
sendEmail |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
ForgotPasswordSetNewPasswordAsync(IUserCredentials, Nullable<Boolean>, CancellationToken)
Declaration
public Task<IForgotPasswordResponse> ForgotPasswordSetNewPasswordAsync(IUserCredentials user, bool? sendEmail, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
IUserCredentials |
user |
|
System.Nullable<System.Boolean> |
sendEmail |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
GetFactorAsync(String, CancellationToken)
Declaration
public Task<IUserFactor> GetFactorAsync(string factorId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
factorId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IUserFactor> |
|
GetLinkedObjects(String, String, Nullable<Int32>)
Declaration
public ICollectionClient<IResponseLinks> GetLinkedObjects(string relationshipName, string after = null, int? limit)
Parameters
Type |
Name |
Description |
System.String |
relationshipName |
|
System.String |
after |
|
System.Nullable<System.Int32> |
limit |
|
Returns
GetRefreshTokenForUserAndClientAsync(String, String, String, Nullable<Int32>, String, CancellationToken)
Declaration
public Task<IOAuth2RefreshToken> GetRefreshTokenForUserAndClientAsync(string clientId, string tokenId, string expand = null, int? limit, string after = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
clientId |
|
System.String |
tokenId |
|
System.String |
expand |
|
System.Nullable<System.Int32> |
limit |
|
System.String |
after |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
ListAssignedRoles(String)
Declaration
public ICollectionClient<IRole> ListAssignedRoles(string expand = null)
Parameters
Type |
Name |
Description |
System.String |
expand |
|
Returns
ListClients()
Declaration
public ICollectionClient<IOAuth2Client> ListClients()
Returns
ListFactors()
Declaration
public ICollectionClient<IUserFactor> ListFactors()
Returns
ListGrants(String, String, String, Nullable<Int32>)
Declaration
public ICollectionClient<IOAuth2ScopeConsentGrant> ListGrants(string scopeId = null, string expand = null, string after = null, int? limit)
Parameters
Type |
Name |
Description |
System.String |
scopeId |
|
System.String |
expand |
|
System.String |
after |
|
System.Nullable<System.Int32> |
limit |
|
Returns
ListGroupTargets(String, String, Nullable<Int32>)
Declaration
public ICollectionClient<IGroup> ListGroupTargets(string roleId, string after = null, int? limit)
Parameters
Type |
Name |
Description |
System.String |
roleId |
|
System.String |
after |
|
System.Nullable<System.Int32> |
limit |
|
Returns
ListIdentityProviders()
Declaration
public ICollectionClient<IIdentityProvider> ListIdentityProviders()
Returns
ListRefreshTokensForUserAndClient(String, String, String, Nullable<Int32>)
Declaration
public ICollectionClient<IOAuth2RefreshToken> ListRefreshTokensForUserAndClient(string clientId, string expand = null, string after = null, int? limit)
Parameters
Type |
Name |
Description |
System.String |
clientId |
|
System.String |
expand |
|
System.String |
after |
|
System.Nullable<System.Int32> |
limit |
|
Returns
ListSupportedFactors()
Declaration
public ICollectionClient<IUserFactor> ListSupportedFactors()
Returns
ListSupportedSecurityQuestions()
Declaration
public ICollectionClient<ISecurityQuestion> ListSupportedSecurityQuestions()
Returns
ReactivateAsync(Nullable<Boolean>, CancellationToken)
Declaration
public Task<IUserActivationToken> ReactivateAsync(bool? sendEmail, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Nullable<System.Boolean> |
sendEmail |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
RemoveFromGroupAsync(String, CancellationToken)
Removes a user from a group
Declaration
public Task RemoveFromGroupAsync(string groupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
groupId |
The group id
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
The asynchronous task
|
RemoveGroupTargetAsync(String, String, CancellationToken)
Declaration
public Task RemoveGroupTargetAsync(string roleId, string groupId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
roleId |
|
System.String |
groupId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RemoveLinkedObjectAsync(String, CancellationToken)
Declaration
public Task RemoveLinkedObjectAsync(string relationshipName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
relationshipName |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RemoveRoleAsync(String, CancellationToken)
Declaration
public Task RemoveRoleAsync(string roleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
roleId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
ResetFactorsAsync(CancellationToken)
Declaration
public Task ResetFactorsAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
ResetPasswordAsync(Nullable<Boolean>, CancellationToken)
Declaration
public Task<IResetPasswordToken> ResetPasswordAsync(bool? sendEmail, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Nullable<System.Boolean> |
sendEmail |
The send email flag
|
System.Threading.CancellationToken |
cancellationToken |
The cancellation token
|
Returns
RevokeGrantAsync(String, CancellationToken)
Declaration
public Task RevokeGrantAsync(string grantId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
grantId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RevokeGrantsAsync(CancellationToken)
Declaration
public Task RevokeGrantsAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RevokeGrantsForUserAndClientAsync(String, CancellationToken)
Declaration
public Task RevokeGrantsForUserAndClientAsync(string clientId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
clientId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RevokeTokenForUserAndClientAsync(String, String, CancellationToken)
Declaration
public Task RevokeTokenForUserAndClientAsync(string clientId, string tokenId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
clientId |
|
System.String |
tokenId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RevokeTokensForUserAndClientAsync(String, CancellationToken)
Declaration
public Task RevokeTokensForUserAndClientAsync(string clientId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
clientId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SetLinkedObjectAsync(String, String, CancellationToken)
Declaration
public Task SetLinkedObjectAsync(string primaryRelationshipName, string primaryUserId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.String |
primaryRelationshipName |
|
System.String |
primaryUserId |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SuspendAsync(CancellationToken)
Declaration
public Task SuspendAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
UnlockAsync(CancellationToken)
Declaration
public Task UnlockAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
UnsuspendAsync(CancellationToken)
Declaration
public Task UnsuspendAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
UpdateAsync(CancellationToken)
Saves changes and returns the updated resource.
Declaration
public Task<IUser> UpdateAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
The cancellation token.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IUser> |
The updated IUser.
|
Implements