public OidcClientDto Create(ServerDto serverDto, string tenant, OidcClientMetadataDto oidcClientMetadataDto, Token token) { tenant = Uri.EscapeDataString(tenant); var json = JsonConvert.Serialize(oidcClientMetadataDto); var url = string.Format(_serviceConfigManager.GetOidcClientsEndPoint(), serverDto.Protocol, serverDto.ServerName, serverDto.Port, tenant); ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); }; var requestConfig = new RequestSettings { Method = HttpMethod.Post, }; var headers = ServiceHelper.AddHeaders(ServiceConstants.JsonContentType); json = "access_token=" + token.AccessToken + "&token_type=" + token.TokenType.ToString().ToLower() + "&" + json; var response = _webRequestManager.GetResponse(url, requestConfig, headers, null, json); return(JsonConvert.Deserialize <OidcClientDto>(response)); }