Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
AuthenticationResult.cs
1using System.Collections.Generic;
2
3namespace Paiwise
4{
9 {
14 {
15 this.Result = null;
16 this.ErrorType = ErrorType.None;
17 }
18
24 {
25 this.Result = Result;
26 this.ErrorType = ErrorType.None;
27 }
28
35 public AuthenticationResult(ErrorType ErrorType, string ErrorMessage, params KeyValuePair<string, object>[] Tags)
36 : this(ErrorType, ErrorMessage, string.Empty, string.Empty, Tags)
37 {
38 }
39
47 public AuthenticationResult(ErrorType ErrorType, string ErrorMessage, string ErrorLanguage, params KeyValuePair<string, object>[] Tags)
48 : this(ErrorType, ErrorMessage, ErrorLanguage, string.Empty, Tags)
49 {
50 }
51
61 params KeyValuePair<string, object>[] Tags)
62 {
63 if (ErrorType == ErrorType.Client)
64 this.Result = false;
65 else
66 this.Result = null;
67
68 this.ErrorType = ErrorType;
69 this.ErrorMessage = ErrorMessage;
70 this.ErrorLanguage = ErrorLanguage;
71 this.ErrorCode = ErrorCode;
72 this.Tags = Tags;
73 }
74
80 public bool? Result { get; }
81
85 public ErrorType ErrorType { get; }
86
90 public string ErrorMessage { get; }
91
95 public string ErrorLanguage { get; }
96
100 public string ErrorCode { get; }
101
105 public KeyValuePair<string, object>[] Tags { get; }
106 }
107}
Basic implementation of IAuthenticationResult.
bool? Result
true = authentication successful false = authentication rejected null = unable to perform authenticat...
ErrorType ErrorType
Type of error.
AuthenticationResult(ErrorType ErrorType, string ErrorMessage, string ErrorLanguage, params KeyValuePair< string, object >[] Tags)
Error result.
string ErrorMessage
Optional Error message that can be sent to origin
AuthenticationResult(ErrorType ErrorType, string ErrorMessage, string ErrorLanguage, string ErrorCode, params KeyValuePair< string, object >[] Tags)
Error result.
AuthenticationResult(bool Result)
Authentication result
string ErrorLanguage
Optional language of error message
string ErrorCode
Optional Machine-readable error code.
AuthenticationResult(ErrorType ErrorType, string ErrorMessage, params KeyValuePair< string, object >[] Tags)
Error result.
KeyValuePair< string, object >[] Tags
Tags annotating the error message.
Interface for authentication results
ErrorType
Type of error.