Class ExchangePrincipal

Assembly: redb.Route.dll

The identity of the caller an exchange came from (Apache Camel Exchange.AUTHENTICATION).
A consumer that knows who sent the request stores the principal here, and processors, policies and
tools read it from here rather than from transport-specific headers.

It is an exchange property, not a header, on purpose. Headers are filled from the wire, so a
caller can send any header name it likes, and producers bridge headers on to the next system.
Properties are written only by code running in this process and never travel to a broker. Every
exchange copy (child, linked child, clone, snapshot) inherits properties, so a sub-route, a split part
or a tool call sees the identity of the request that started it.


The server-side HTTP-family consumers fill it from the shared host's principal resolver or from the
transport's own authenticate hook. A route that validates credentials itself — a bearer token checked
in a processor — records the outcome the same way, with .

public static class ExchangePrincipal

Inheritance

Object→ExchangePrincipal

Methods

Get(IExchange)

Returns the caller's principal, or null when the exchange carries no identity.

public static ClaimsPrincipal? Get(IExchange exchange)

Set(IExchange, ClaimsPrincipal?)

Stores principal as the caller's identity; null removes it.

public static void Set(IExchange exchange, ClaimsPrincipal? principal)