Click or drag to resize

IIdentityApi Interface

Provide the methods for working with user identity

Namespace:  Casewhere.Runtime.DSL.Api
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
public interface IIdentityApi

The IIdentityApi type exposes the following members.

Methods
  NameDescription
Public methodCode exampleCheckUserSessionValidity
Check user session still valid/active
Examples
var identityApi = ctx.Use<IIdentityApi>();
identityApi.CheckUserSessionValidity("623977EE-BD06-4256-8D66-9B94A7BE6FCC");
Public methodCode exampleCreateAuthorizationCode
To create an authorization code to serve for getting the access token later.
Examples
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 methodGetUserClaimsBySPIdPSession
Get the claim collection of a given SPIDPSessionId
Public methodGetUserClaimsByUserSessionId
Get the claim collection of a given UserSessionId
Public methodCode exampleImpersonate
To pretend to be someone else by changing another username
Examples
var identityApi = ctx.Use<IIdentityApi>();
identityApi.Impersonate("dtt");
Public methodCode exampleSetClaim
Set the new claim into identity
Examples
var identityApi = ctx.Use<IIdentityApi>();
identityApi.SetClaim("CPR", "123456789");
Public methodCode exampleSetClaimForSPIdPSession
Update the claim set of the given SPIdPSession and this update will affect to the access token later
Examples
var identityApi = ctx.Use<IIdentityApi>();
identityApi.SetClaimForSPIdPSession("00000000-0000-0000-0000-000000000000", "CPR", "123456789");
Public methodCode exampleSetClaimForUserSession
Update the claim set of the given UserSession and this update will affect to the access token right after
Examples
var identityApi = ctx.Use<IIdentityApi>();
identityApi.SetClaimForUserSession("00000000-0000-0000-0000-000000000000", "CPR", "123456789");
Public methodCode exampleTerminateAccessToken
To terminate all user sessions related to given access token.
Examples
var identityApi = ctx.Use<IIdentityApi>();
identityApi.TerminateAccessToken("Enter your access token");
Public methodCode exampleTerminateUserSession
To terminate the user session of given username.
Examples
var identityApi = ctx.Use<IIdentityApi>();
identityApi.TerminateUserSession("dtt");
Public methodTryToGetUserToken
Try to get the user token from the given access token.
Top
See Also