Skip to content

.Net Library to convert Microsoft Identity Errors to exceptions

License

Notifications You must be signed in to change notification settings

mabroukmahdhi/Identiteption

Repository files navigation

Nuget

Nuget Nuget

Social

Twitter Follow

Identiteption

.Net Library that throws exceptions based on Microsoft Identity Result IdentityResult.

About Identity Error Codes

Source: IdentityResult

Possible error codes

  • ConcurrencyFailure
  • DefaultError
  • DuplicateEmail
  • DuplicateRoleName
  • DuplicateUserName
  • InvalidEmail
  • InvalidRoleName
  • InvalidToken
  • InvalidUserName
  • LoginAlreadyAssociated
  • PasswordMismatch
  • PasswordRequiresDigit
  • PasswordRequiresLower
  • PasswordRequiresNonAlphanumeric
  • PasswordRequiresUniqueChars
  • PasswordRequiresUpper
  • PasswordTooShort
  • RecoveryCodeRedemptionFailed
  • UserAlreadyHasPassword
  • UserAlreadyInRole
  • UserLockoutNotEnabled
  • UserNotInRole

What exception?

There are three types of exceptions that can be thrown: IdentityValidationException, FailedIdentityServiceException or IdentityServiceException.

Error code Throws IdentityValidationException Throws FailedIdentityServiceException Throws IdentityServiceException
ConcurrencyFailure X
DefaultError X
DuplicateEmail X
DuplicateRoleName X
DuplicateUserName X
InvalidEmail X
InvalidRoleName X
InvalidToken X
InvalidUserName X
LoginAlreadyAssociated X
PasswordMismatch X
PasswordRequiresDigit X
PasswordRequiresLower X
PasswordRequiresNonAlphanumeric X
PasswordRequiresUniqueChars X
PasswordRequiresUpper X
PasswordTooShort X
RecoveryCodeRedemptionFailed X
UserAlreadyHasPassword X
UserAlreadyInRole X
UserLockoutNotEnabled X
UserNotInRole X

Usage

It is very easy and simple to use this, you only need to call the extension Throw:

IdentityResult identityResult = ....;

identityResult.Throw();

About

.Net Library to convert Microsoft Identity Errors to exceptions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages