IIdentityRepository

Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll

Summary

Provides an abstraction to implement a repository for identity tokens in the database/ORM technology of your choice.

Methods

GetAuth(authUrn)

Summary

Gets the identity token details for the specified authUrn.

Returns

The identity token details for the specified authUrn.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

CreateNewUserSession(user,longLived,impersonatedUserId)

Summary

Creates a new userSession entity for the specified user in the database.

Returns

the identity token details for the userSession entity just created.

Parameters
Name Type Description
user ASPSecurityKit.IUser The user.
longLived System.Boolean if set to true the session must have a minimum expiration as specified by RememberMeTimeoutInMinutes.
impersonatedUserId System.Nullable<Guid> The impersonated userId. If specified creates a bound impersonated session.

SlideExpiration(auth)

Summary

Slides the expiration of the specified identity token.

Returns

true if expiration for the identity token was slid further; otherwise, false.

Parameters
Name Type Description
auth ASPSecurityKit.IAuthDetails The identity token details object.
Remarks

Note to implementers: If sliding isn’t supported just return false (do not throw an exception.)

Expire(authUrn)

Summary

Expires the identity token represented by the specified authUrn.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

ExpireUserSessions(user,exceptThisSessionUrn)

Summary

Expires the active session identities related to the specified user except the provided session (if specified).

Parameters
Name Type Description
user ASPSecurityKit.IUser The user instance
exceptThisSessionUrn System.String An authUrn of type UserSession.

SlideRecentAccessWithMFAVerification(authUrn)

Summary

Updates the latest recorded time at which an activity has occurred on this token with multi-factor state as verified.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

SetMFAVerificationValidUntilSessionExpired(authUrn)

Summary

Marks user as verified with MFA for the lifetime of the specified token.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

GetAuthAsync(authUrn)

Summary

Gets the identity token details for the specified authUrn.

Returns

The identity token details for the specified authUrn.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

GetAuthAsync(authUrn,cancellationToken)

Summary

Gets the identity token details for the specified authUrn.

Returns

The identity token details for the specified authUrn.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].
cancellationToken System.Threading.CancellationToken The cancellation token.

CreateNewUserSessionAsync(user,longLived,impersonatedUserId)

Summary

Creates a new userSession entity for the specified user in the database.

Returns

the identity token details for the userSession entity just created.

Parameters
Name Type Description
user ASPSecurityKit.IUser The user.
longLived System.Boolean if set to true the session must have a minimum expiration as specified by RememberMeTimeoutInMinutes.
impersonatedUserId System.Nullable<Guid> The impersonated userId. If specified creates a bound impersonated session.

CreateNewUserSessionAsync(user,longLived,cancellationToken,impersonatedUserId)

Summary

Creates a new userSession entity for the specified user in the database.

Returns

the identity token details for the userSession entity just created.

Parameters
Name Type Description
user ASPSecurityKit.IUser The user.
longLived System.Boolean if set to true the session must have a minimum expiration as specified by RememberMeTimeoutInMinutes.
cancellationToken System.Threading.CancellationToken The cancellation token.
impersonatedUserId System.Nullable<Guid> The impersonated userId. If specified creates a bound impersonated session.

SlideExpirationAsync(auth)

Summary

Slides the expiration of the specified identity token.

Returns

true if expiration for the identity token was slid further; otherwise, false.

Parameters
Name Type Description
auth ASPSecurityKit.IAuthDetails The identity token details object.
Remarks

Note to implementers: If sliding isn’t supported just return false (do not throw an exception.)

SlideExpirationAsync(auth,cancellationToken)

Summary

Slides the expiration of the specified identity token.

Returns

true if expiration for the identity token was slid further; otherwise, false.

Parameters
Name Type Description
auth ASPSecurityKit.IAuthDetails The identity token details object.
cancellationToken System.Threading.CancellationToken The cancellation token.
Remarks

Note to implementers: If sliding isn’t supported just return false (do not throw an exception.)

ExpireAsync(authUrn)

Summary

Expires the identity token represented by the specified authUrn.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

ExpireAsync(authUrn,cancellationToken)

Summary

Expires the identity token represented by the specified authUrn.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].
cancellationToken System.Threading.CancellationToken The cancellation token.

ExpireUserSessionsAsync(user,exceptThisSessionUrn)

Summary

Expires the active session identities related to the specified user except the provided session (if specified).

Parameters
Name Type Description
user ASPSecurityKit.IUser The user instance
exceptThisSessionUrn System.String An authUrn of type UserSession.

ExpireUserSessionsAsync(user,cancellationToken,exceptThisSessionUrn)

Summary

Expires the active session identities related to the specified user except the provided session (if specified).

Parameters
Name Type Description
user ASPSecurityKit.IUser The user instance
cancellationToken System.Threading.CancellationToken The cancellation token.
exceptThisSessionUrn System.String An authUrn of type UserSession.

SlideRecentAccessWithMFAVerificationAsync(authUrn)

Summary

Updates the latest recorded time at which an activity has occurred on this token with multi-factor state as verified.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

SlideRecentAccessWithMFAVerificationAsync(authUrn,cancellationToken)

Summary

Updates the latest recorded time at which an activity has occurred on this token with multi-factor state as verified.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].
cancellationToken System.Threading.CancellationToken The cancellation token.

SetMFAVerificationValidUntilSessionExpiredAsync(authUrn)

Summary

Marks user as verified with MFA for the lifetime of the specified token.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].

SetMFAVerificationValidUntilSessionExpiredAsync(authUrn,cancellationToken)

Summary

Marks user as verified with MFA for the lifetime of the specified token.

Parameters
Name Type Description
authUrn System.String An urn in the format [idTokenType]:[idToken] for instance apikey:[apiKeyGuid].
cancellationToken System.Threading.CancellationToken The cancellation token.