IIdentity
|
public interface IIdentityApi
The IIdentityApi type exposes the following members.
| Name | Description | |
|---|---|---|
| CheckUserSessionValidity |
Check user session still valid/active
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.CheckUserSessionValidity("623977EE-BD06-4256-8D66-9B94A7BE6FCC"); | |
| CreateAuthorizationCode |
To create an authorization code to serve for getting the access token later.
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); | |
| GetClaims | Get all values of a given claim in the current user claim collection. | |
| GetExpiredTime |
Get the user session expired time
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.GetExpiredTime("623977EE-BD06-4256-8D66-9B94A7BE6FCC"); | |
| GetUserClaims | Get the claim collection of the current user. | |
| GetUserClaimsBySPIdPSession | Get the claim collection of a given SPIDPSessionId | |
| GetUserClaimsByUserSessionId | Get the claim collection of a given UserSessionId | |
| Impersonate |
To pretend to be someone else by changing another username
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.Impersonate("dtt"); | |
| RemoveClaim | Remove a given claim in the current user claim collection. | |
| SetClaim |
Set the new claim into identity
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.SetClaim("CPR", "123456789"); | |
| SetClaimForSPIdPSession |
Update the claim set of the given SPIdPSession and this update will affect to the access token later
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.SetClaimForSPIdPSession("00000000-0000-0000-0000-000000000000", "CPR", "123456789"); | |
| SetClaimForUserSession |
Update the claim set of the given UserSession and this update will affect to the access token right after
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.SetClaimForUserSession("00000000-0000-0000-0000-000000000000", "CPR", "123456789"); | |
| TerminateAccessToken |
To terminate all user sessions related to given access token.
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.TerminateAccessToken("Enter your access token"); | |
| TerminateUserSession(Guid) |
To terminate the user session of given userSessionId.
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.TerminateUserSession("623977EE-BD06-4256-8D66-9B94A7BE6FCC"); | |
| TerminateUserSession(String) |
To terminate the user session of given username.
C# var identityApi = ctx.Use<IIdentityApi>(); identityApi.TerminateUserSession("dtt"); | |
| TryToGetUserToken | Try to get the user token from the given access token. |