Exemple #1
0
        public static string GetAcsToken(IntegrationServiceDetails integrationServiceDetails)
        {
            var        address = integrationServiceDetails.DeploymentURL;
            UriBuilder integrationDeploymentBaseUrl = new UriBuilder(address);

            integrationDeploymentBaseUrl.Scheme = "http";

            if (integrationDeploymentBaseUrl.Port == 443)
            {
                integrationDeploymentBaseUrl.Port = -1;
            }

            var partnerManagementDataServiceUrl = new Uri(integrationDeploymentBaseUrl.Uri, PartnerManagementDataServicePath);
            var token = AcsHelper.GetAcsToken(integrationServiceDetails.AcsNamespace, integrationServiceDetails.IssuerName, integrationServiceDetails.IssuerKey, partnerManagementDataServiceUrl.ToString());

            return(token);
        }
        private static Services.TpmContext GetCloudTpmContext(IntegrationServiceDetails integrationServiceDetails)
        {
            var partnerManagementDataServiceUrl =
                new Uri(new Uri(integrationServiceDetails.DeploymentURL), PartnerManagementDataServicePath);

            Services.TpmContext context = new Services.TpmContext(partnerManagementDataServiceUrl);
            context.SaveChangesDefaultOptions = SaveChangesOptions.Batch;
            context.SendingRequest           += (sender, args) => OnSendingRequest(args, AcsHelper.GetAcsToken(integrationServiceDetails));
            return(context);
        }