示例#1
0
        public List <CertificateChainDto> GetCertificates(ServerDto serverDto, string tenantName, CertificateScope scope, Token token)
        {
            tenantName = Uri.EscapeDataString(tenantName);
            var url = string.Format(_serviceConfigManager.GetCertificatesPostEndPoint(), serverDto.Protocol, serverDto.ServerName, serverDto.Port, tenantName);

            url += "?scope=" + scope;
            ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };
            var requestConfig = new RequestSettings
            {
                Method = HttpMethod.Post
            };
            var headers  = ServiceHelper.AddHeaders(ServiceConstants.JsonContentType);
            var postData = "access_token=" + token.AccessToken + "&token_type=" + token.TokenType.ToString().ToLower();
            var response = _webRequestManager.GetResponse(url, requestConfig, headers, null, postData);

            return(JsonConvert.Deserialize <List <CertificateChainDto> >(response));
        }