Exemplo n.º 1
0
        private static async Task GenerateBearerTokens(TestContext context)
        {
            context.Tokens.TestApiBearerToken = await ConfigurationManager.GetBearerToken(
                context.VideoWebConfig.AzureAdConfiguration, context.VideoWebConfig.VhServices.TestApiResourceId);

            context.Tokens.TestApiBearerToken.Should().NotBeNullOrEmpty();

            context.Tokens.CallbackBearerToken = GenerateTemporaryTokens.SetCustomJwTokenForCallback(context.VideoWebConfig.VideoWebKinlyConfiguration);
            context.Tokens.CallbackBearerToken.Should().NotBeNullOrEmpty();
        }
        private static async Task GenerateBearerTokens(TestContext context)
        {
            var azureAdConfigurationOptions = Options.Create(context.VideoWebConfig.AzureAdConfiguration);
            var tokenProvider = new TokenProvider(azureAdConfigurationOptions);

            context.Tokens.TestApiBearerToken = await tokenProvider.GetClientAccessToken(context.VideoWebConfig.AzureAdConfiguration.ClientId, context.VideoWebConfig.AzureAdConfiguration.ClientSecret, context.VideoWebConfig.VhServices.TestApiResourceId);

            context.Tokens.TestApiBearerToken.Should().NotBeNullOrEmpty();

            context.Tokens.CallbackBearerToken = GenerateTemporaryTokens.SetCustomJwTokenForCallback(context.VideoWebConfig.VideoWebKinlyConfiguration);
            context.Tokens.CallbackBearerToken.Should().NotBeNullOrEmpty();
        }
 private IRestResponse SendEventToVideoWeb(CallbackEvent request)
 {
     _c.Test.AlertTime             = _c.TimeZone.Adjust(DateTime.Now);
     _c.Tokens.CallbackBearerToken = GenerateTemporaryTokens.SetCustomJwTokenForCallback(_c.VideoWebConfig.VideoWebKinlyConfiguration);
     return(new VideoWebApiManager(_c.VideoWebConfig.VhServices.VideoWebUrl, _c.Tokens.CallbackBearerToken).SendCallBackEvent(request));
 }