AgentClaims.IsAgent(ClaimsIdentity) Method

Definition

Checks if the given incoming identity represents an Agent claim (not coming from ABS/SMBA).

public static bool IsAgent(this System.Security.Claims.ClaimsIdentity identity);
static member IsAgent : System.Security.Claims.ClaimsIdentity -> bool
<Extension()>
Public Function IsAgent (identity As ClaimsIdentity) As Boolean

Parameters

identity
ClaimsIdentity

The incoming identity to evaluate.

Returns

True if the incoming identity represents an Agent claim, false if it does not.

Remarks

An Agent claim should contain: An VersionClaim claim. An AudienceClaim claim. An AppIdClaim claim (v1) or a AuthorizedParty claim (v2). And the appId claim should be different than the audience claim. When a channel (webchat, teams, etc.) invokes an Agent, the AudienceClaim is set to BotFrameworkTokenIssuer but when an Agent calls another Agent, the audience claim is set to the appId of the Agent being invoked. The protocol supports v1 and v2 tokens: For v1 tokens, the AppIdClaim is present and set to the app Id of the calling Agent. For v2 tokens, the AuthorizedParty is present and set to the app Id of the calling Agent.

Applies to