public async void EnterpriseChannelValidation_Succeeds()
 {
     var appId       = "1234567890";
     var serviceUrl  = "https://webchat.botframework.com/";
     var credentials = new SimpleCredentialProvider(appId, String.Empty);
     var identity    = new SimpleClaimsIdentity(new List <Claim>()
     {
         new Claim(AuthenticationConstants.AudienceClaim, appId, null, AuthenticationConstants.ToBotFromChannelTokenIssuer),
         new Claim(AuthenticationConstants.ServiceUrlClaim, serviceUrl, null),
     }, true);
     await EnterpriseChannelValidation.ValidateIdentity(identity, credentials, serviceUrl);
 }
        public async void EnterpriseChannelValidation_NoAudienceClaim_Fails()
        {
            var appId       = "1234567890";
            var serviceUrl  = "https://webchat.botframework.com/";
            var credentials = new SimpleCredentialProvider(appId, String.Empty);
            var identity    = new SimpleClaimsIdentity(new List <Claim>()
            {
                new Claim(AuthenticationConstants.ServiceUrlClaim, serviceUrl, null),
            }, true);

            await Assert.ThrowsAsync <UnauthorizedAccessException>(
                async() => await EnterpriseChannelValidation.ValidateIdentity(identity, credentials, serviceUrl));
        }