EndorsementsValidator.Validate(String, HashSet<String>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Verify that the specified endorsement exists on the JWT token. Call this method multiple times to validate multiple endorsements. For example, if an Activity comes from WebChat, that activity's ChannelId property is set to "webchat" and the signing party of the JWT token must have a corresponding endorsement of “Webchat”.
public static bool Validate (string expectedEndorsement, System.Collections.Generic.HashSet<string> endorsements);
static member Validate : string * System.Collections.Generic.HashSet<string> -> bool
Public Shared Function Validate (expectedEndorsement As String, endorsements As HashSet(Of String)) As Boolean
Parameters
- expectedEndorsement
- String
The expected endorsement. Generally the ID of the channel to validate, typically extracted from the activity's ChannelId property, that to which the Activity is affinitized. Alternatively, it could represent a compliance certification that is required.
The JWT token’s signing party is permitted to send activities only for specific channels. That list, the set of channels the service can sign for, is called the endorsement list. The activity’s ChannelId MUST be found in the endorsement list, or the incoming activity is not considered valid.
Returns
True if the channel ID is found in the endorsements list; otherwise, false.
Remarks
JWT token signing keys contain endorsements matching the IDs of the channels they are approved to sign for. They also contain keywords representing compliance certifications. This code ensures that a channel ID or compliance certification is present on the signing key used for the request's token.