EndorsementsValidator class

Contains helper methods for verifying JWT endorsements.

Methods

validate(string, string[])

Verify that the set of ChannelIds, which come from the incoming activities, all match the endorsements found on the JWT Token. For example, if an Activity comes from webchat, that channelId says says "webchat" and the jwt token endorsement MUST match that.

Method Details

validate(string, string[])

Verify that the set of ChannelIds, which come from the incoming activities, all match the endorsements found on the JWT Token. For example, if an Activity comes from webchat, that channelId says says "webchat" and the jwt token endorsement MUST match that.

static function validate(channelId: string, endorsements: string[]): boolean

Parameters

channelId

string

The channel name, typically extracted from the activity.ChannelId field, that to which the Activity is affinitized.

endorsements

string[]

Whoever signed the JWT token is permitted to send activities only for some specific channels. That list is the endorsement list, and is validated here against the channelId.

Returns

boolean

True is the channelId is found in the Endorsement set. False if the channelId is not found.