コード例 #1
0
        public SoapEditorProxy(Connections.ConnectionData connData, ServiceDescription description, XmlSchemaSet schemas)
        {
            _connData = connData;
            _descrip  = description;
            _schemas  = schemas;
            _helper   = new XmlCompletionDataProvider(schemas, "http://schemas.xmlsoap.org/soap/envelope/"
                                                      , "soapenv", () => "xmlns:soap=\"" + description.TargetNamespace + "\""
                                                      , e => (e.Name == "Envelope" && e.QualifiedName.Namespace == "http://schemas.xmlsoap.org/soap/envelope/") ||
                                                      TypeMatchesAction(e.QualifiedName, this.Action));

            _baseUrl = new Uri(_connData.Url).GetLeftPart(UriPartial.Path);
            switch (_connData.Authentication)
            {
            case Connections.Authentication.Windows:
                _cred = CredentialCache.DefaultNetworkCredentials;
                break;

            case Connections.Authentication.Explicit:
                _cred = new NetworkCredential(_connData.UserName, _connData.Password);
                break;
            }

            _actionUrls = _descrip.Services.OfType <Service>()
                          .SelectMany(s => s.Ports.OfType <Port>().Where(SoapPort))
                          .SelectMany(p => _descrip.Bindings[p.Binding.Name].Operations.OfType <OperationBinding>())
                          .Select(o => new { Name = o.Name, Address = o.Extensions.OfType <SoapOperationBinding>().First().SoapAction })
                          .Distinct()
                          .ToDictionary(a => a.Name, a => a.Address);
        }
コード例 #2
0
    public SoapEditorProxy(Connections.ConnectionData connData, ServiceDescription description, XmlSchemaSet schemas)
    {
      _connData = connData;
      _descrip = description;
      _schemas = schemas;
      _helper = new XmlCompletionDataProvider(schemas, "http://schemas.xmlsoap.org/soap/envelope/"
        , "soapenv", () => "xmlns:soap=\"" + description.TargetNamespace + "\""
        , e => (e.Name == "Envelope" && e.QualifiedName.Namespace == "http://schemas.xmlsoap.org/soap/envelope/")
          || TypeMatchesAction(e.QualifiedName, this.Action));

      _baseUrl = new Uri(_connData.Url).GetLeftPart(UriPartial.Path);
      switch (_connData.Authentication)
      {
        case Connections.Authentication.Windows:
          _cred = CredentialCache.DefaultNetworkCredentials;
          break;
        case Connections.Authentication.Explicit:
          _cred = new NetworkCredential(_connData.UserName, _connData.Password);
          break;
      }

      _actionUrls = _descrip.Services.OfType<Service>()
        .SelectMany(s => s.Ports.OfType<Port>().Where(SoapPort))
        .SelectMany(p => _descrip.Bindings[p.Binding.Name].Operations.OfType<OperationBinding>())
        .Select(o => new { Name = o.Name, Address = o.Extensions.OfType<SoapOperationBinding>().First().SoapAction })
        .Distinct()
        .ToDictionary(a => a.Name, a => a.Address);
    }
		public V1CredsAPIConnector(string urlPrefix, System.Net.ICredentials creds = null, ProxyProvider proxy = null)
		{
			_urlPrefix = urlPrefix;
			_proxyProvider = proxy;
			_creds = creds ?? CredentialCache.DefaultCredentials;
			var myproxy = _proxyProvider == null ? null : _proxyProvider.CreateWebProxy();
		}
コード例 #4
0
ファイル: AtomLinkAsset.cs プロジェクト: Terradue/Stars
 public AtomLinkAsset(SyndicationLink link, SyndicationItem item, System.Net.ICredentials credentials = null)
 {
     this.link        = link;
     this.item        = item;
     this.credentials = credentials;
     this.webRoute    = WebRoute.Create(Uri, Convert.ToUInt64(link.Length), credentials);
 }
コード例 #5
0
 public V1CredsAPIConnector(string urlPrefix, System.Net.ICredentials creds = null, ProxyProvider proxy = null)
 {
     _urlPrefix     = urlPrefix;
     _proxyProvider = proxy;
     _creds         = creds ?? CredentialCache.DefaultCredentials;
     var myproxy = _proxyProvider == null ? null : _proxyProvider.CreateWebProxy();
 }
コード例 #6
0
 private Proxy(Uri address, System.Net.ICredentials credentials)
 {
     this.NativeProxy = new WebProxy
     {
         Address     = address,
         Credentials = credentials
     };
 }
コード例 #7
0
 public Task PreAuthenticate(IRestClient client, IRestRequest request, System.Net.ICredentials credentials)
 {
     return(Task.Run(() =>
     {
         if (!string.IsNullOrEmpty(AccessToken))
         {
             request.AddHeader("Authorization", "Bearer " + AccessToken);
         }
     }));
 }
コード例 #8
0
    public SharepointEditorProxy(Connections.ConnectionData connData)
    {
      _connData = connData;

      switch (_connData.Authentication)
      {
        case Connections.Authentication.Windows:
          _cred = CredentialCache.DefaultNetworkCredentials;
          break;
        case Connections.Authentication.Explicit:
          _cred = new NetworkCredential(_connData.UserName, _connData.Password);
          break;
      }
    }
コード例 #9
0
 public VersionOneAPIConnector(string urlPrefix, System.Net.ICredentials credentials = null, ProxyProvider proxyProvider = null)
 {
     _urlPrefix     = urlPrefix;
     _proxyProvider = proxyProvider;
     if (credentials != null)
     {
         _initializedWithCredentials = true;
         Credentials = credentials;
     }
     else
     {
         _credentialCache = new CredentialCache();
         Credentials      = _credentialCache;
     }
 }
		public VersionOneAPIConnector(string urlPrefix, System.Net.ICredentials credentials = null, ProxyProvider proxyProvider = null)
		{
			_urlPrefix = urlPrefix;
			_proxyProvider = proxyProvider;
			if (credentials != null)
			{
				_initializedWithCredentials = true;
				Credentials = credentials;
			}
			else
			{
				_credentialCache = new CredentialCache();
				Credentials = _credentialCache;
			}
		}
コード例 #11
0
        public SharepointEditorProxy(Connections.ConnectionData connData)
        {
            _connData = connData;

            switch (_connData.Authentication)
            {
            case Connections.Authentication.Windows:
                _cred = CredentialCache.DefaultNetworkCredentials;
                break;

            case Connections.Authentication.Explicit:
                _cred = new NetworkCredential(_connData.UserName, _connData.Password);
                break;
            }

            var handler = new HttpClientHandler();

            handler.Credentials     = _cred;
            handler.PreAuthenticate = true;
            _http = new HttpClient(handler);
        }
コード例 #12
0
 public Task PreAuthenticate(IHttpClient client, IHttpRequestMessage request, System.Net.ICredentials credentials)
 {
     throw new NotImplementedException();
 }
コード例 #13
0
ファイル: RestClient.cs プロジェクト: 40448091/eSecurity
 public RestClient()
 {
     _credentials = System.Net.CredentialCache.DefaultCredentials;
 }
コード例 #14
0
 public bool CanPreAuthenticate(IHttpClient client, IHttpRequestMessage request, System.Net.ICredentials credentials)
 {
     return(false);
 }
コード例 #15
0
 public bool CanPreAuthenticate(IRestClient client, IRestRequest request, System.Net.ICredentials credentials)
 {
     return(true);
 }
コード例 #16
0
ファイル: RestClient.cs プロジェクト: 40448091/eSecurity
 public RestClient(System.Net.ICredentials credentials)
 {
     _credentials = credentials;
 }
コード例 #17
0
ファイル: AtomFeedCatalog.cs プロジェクト: Terradue/Stars
 public AtomFeedCatalog(AtomFeed feed, Uri sourceUri, System.Net.ICredentials credentials = null)
 {
     this.feed        = feed;
     this.sourceUri   = sourceUri;
     this.credentials = credentials;
 }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KmlLayer"/> class which will be a child of another <see cref="KmlLayer"/>.
 /// </summary>
 /// <param name="parentLayer">The parent layer.</param>
 internal KmlLayer(KmlLayer parentLayer)
     : this()
 {
     _parentLayer = parentLayer;
     ProjectionService = parentLayer.ProjectionService;
     ProxyUrl = parentLayer.ProxyUrl;
     VisibleLayers = parentLayer.VisibleLayers;
     InitializationFailed += KmlLayer_InitializationFailed; // To avoid crash and report error to parent
     #if !WINDOWS_PHONE
     MapTip = parentLayer.MapTip;
     #endif
     #if !SILVERLIGHT || WINDOWS_PHONE
     Credentials = parentLayer.Credentials;
     #endif
     #if !SILVERLIGHT
     ClientCertificate = parentLayer.ClientCertificate;
     #endif
 }
コード例 #19
0
 public DigestAuthenticator(System.Net.ICredentials credentials)
 {
     this.credentials = credentials;
 }
コード例 #20
0
ファイル: AtomItemNode.cs プロジェクト: Terradue/Stars
 public AtomItemNode(AtomItem item, Uri sourceUri, System.Net.ICredentials credentials = null)
 {
     this.item        = item;
     this.sourceUri   = sourceUri;
     this.credentials = credentials;
 }
コード例 #21
0
ファイル: ReportUtil2.cs プロジェクト: borjancace/SoaScapeRep
        private bool getCredentials()
        {
            try
            {
                if (m_windowsAuthentication)
                    m_credentials = System.Net.CredentialCache.DefaultCredentials;
                else
                    m_credentials = new System.Net.NetworkCredential(m_userid, m_password, m_domain);
                hasCredentials = true;
            }
            catch (Exception ex)
            {
                string err;
                if (m_windowsAuthentication)
                    err = "ERR: Unable to get credentials for Windows Authentication \n" + ex.Message;
                else
                    err = "ERR: Unable to get credentials for userid: " + m_userid + " domain: " + m_domain + "\n" + ex.Message;

                if (ex.InnerException != null) err += ex.InnerException.Message;
                if (m_logStream != null) m_logStream.WriteLine(err);
                hasCredentials = false;
            }
            return hasCredentials;
        }