Click or drag to resize

IIdentityApi Methods

The IIdentityApi type exposes the following members.

Methods
  Name Description
Public method Code example CheckUserSessionValidity Check user session still valid/active
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.CheckUserSessionValidity("623977EE-BD06-4256-8D66-9B94A7BE6FCC");
Public method Code example CreateAuthorizationCode To create an authorization code to serve for getting the access token later.
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
var model = new AuthorizationCodeModel 
{
    WorkerSiteDomain = "your-worker.casewhere.com",
    Username = "NemUser",
    Claims = new Dictionary<string, string>{ { "CPR", "12345" } },
    ExpiredSessionMinutes = 180
};
identityApi.CreateAuthorizationCode(model);
Public method Code example GetClaims Get all values of a given claim in the current user claim collection.
Public method Code example GetExpiredTime Get the user session expired time
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.GetExpiredTime("623977EE-BD06-4256-8D66-9B94A7BE6FCC");
Public method Code example GetUserClaims Get the claim collection of the current user.
Public method GetUserClaimsBySPIdPSession Get the claim collection of a given SPIDPSessionId
Public method GetUserClaimsByUserSessionId Get the claim collection of a given UserSessionId
Public method Code example Impersonate To pretend to be someone else by changing another username
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.Impersonate("dtt");
Public method Code example RemoveClaim Remove a given claim in the current user claim collection.
Public method Code example SetClaim Set the new claim into identity
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.SetClaim("CPR", "123456789");
Public method Code example SetClaimForSPIdPSession Update the claim set of the given SPIdPSession and this update will affect to the access token later
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.SetClaimForSPIdPSession("00000000-0000-0000-0000-000000000000", "CPR", "123456789");
Public method Code example SetClaimForUserSession Update the claim set of the given UserSession and this update will affect to the access token right after
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.SetClaimForUserSession("00000000-0000-0000-0000-000000000000", "CPR", "123456789");
Public method Code example TerminateAccessToken To terminate all user sessions related to given access token.
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.TerminateAccessToken("Enter your access token");
Public method Code example TerminateUserSession(Guid) To terminate the user session of given userSessionId.
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.TerminateUserSession("623977EE-BD06-4256-8D66-9B94A7BE6FCC");
Public method Code example TerminateUserSession(String) To terminate the user session of given username.
Example
C#
var identityApi = ctx.Use<IIdentityApi>();
identityApi.TerminateUserSession("dtt");
Public method TryToGetUserToken Try to get the user token from the given access token.
Top
See Also