Class IdentityVerdict
Reads the identity core's verdict out of an answer.
Core states its verdict as an HTTP status code on redbHttp.ResponseCode, on every transport,
because that is the vocabulary its own processors speak. The OAuth error value in the body is
the second source and the weaker one: it is defined by RFC 6749, and Core answers plenty of things
that RFC never named. rate_limited is the standing example — read from the error string alone
it falls through to «bad request», which tells a caller to fix their request when what they must do
is wait.
This type holds no route, no exchange and no transport type on purpose: redb.Identity.Contracts
is dependency-free, and a facade passes in the two values it already has.
public static class IdentityVerdict
Inheritance
Methods
FromOAuthError(string)
The verdict an OAuth error value states, per RFC 6749 §5.2 and RFC 6750 §3.1.
public static IdentityVerdictKind FromOAuthError(string error)
FromStatusCode(int)
The verdict an HTTP status code states.
public static IdentityVerdictKind FromStatusCode(int code)
IsRefusal(IdentityVerdictKind)
Whether this verdict means the request was refused.
public static bool IsRefusal(this IdentityVerdictKind kind)
ParseResponseCode(object?)
Parses a redbHttp.ResponseCode header value. Returns null when the header is absent or is
public static int? ParseResponseCode(object? rawHeaderValue)
Resolve(int?, string?)
The verdict for a request, given what the answer carried. The status code wins where there is
public static IdentityVerdictKind Resolve(int? responseCode, string? oauthError)