internal static string GetErrorTypeString(RegistrationErrorType error) { switch (error) { case RegistrationErrorType.InvalidRedirectUri: return "invalid_redirect_uri"; case RegistrationErrorType.InvalidClientMetadata: return "invalid_client_metadata"; default: throw new NotImplementedException(); } }
internal static string GetDefaultErrorTypeDescription(RegistrationErrorType error) { switch (error) { case RegistrationErrorType.InvalidRedirectUri: return "One or more redirect_uri values are invalid"; case RegistrationErrorType.InvalidClientMetadata: return "One of the Client Metadata fields is invalid and the server has rejected this request"; default: throw new NotImplementedException(); } }
public ClientRegistrationError(RegistrationErrorType error, string description = null) { this.Error = GetErrorTypeString(error); this.ErrorDescription = String.IsNullOrWhiteSpace(description) ? GetDefaultErrorTypeDescription(error) : description; }
public ValidationResult(RegistrationErrorType error, string description = null) { this.ErrorType = error; this.Description = description; this.Success = false; }
public OpenIdClientRegistrationResult(RegistrationErrorType error, string description) { this.ErrorType = error; this.Description = description; this.Success = false; }
public NewUserRegistrationException(RegistrationErrorType reason) : base() { Reason = reason; }
public NewUserRegistrationException(RegistrationErrorType reason, string message, Exception inner) : base(message, inner) { Reason = reason; //might as well create a custom message? }