Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SharePoint List Adapter and HTTPS


SharePoint List Adapter and HTTPS

Author
Message
tony c-440037
tony c-440037
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 221
Hi
I was wondering whether anyone had managed to get the codeplex SSIS SharePoint List Adapter components working with an HTTPS sharepoint site?

I can get them to work with HTTP but i get the following error with HTTPS and I have full control of the sharepoint site i'm trying to connect to.

The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from server was 'Negotiate, NTLM', ---> System.Net.Exception: The remote server returned an error: (401) Unauthorized.

Cheers
naveenka
naveenka
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 46
In the earlier version of the SharePoint List adapters you had to modify the SharePointUtility code which is a VB project to be able to support HTTPS. Basically it uses the SharePoint list webservice and the WCF client configuration is performed in SharePointUtility code which needs to be modified to support HTTPS.

Here is some of the code that you can modify and try
Public Function RemoteCertificateValidationCallback(ByVal sender As Object, ByVal certificate As System.Security.Cryptography.X509Certificates.X509Certificate, ByVal chain As System.Security.Cryptography.X509Certificates.X509Chain, ByVal sslPolicyErrors As System.Net.Security.SslPolicyErrors) As Boolean
Return True
End Function

''' <summary>
''' Resets the conneciton for the current client which is used for the lists service
''' </summary>
''' <remarks></remarks>
Private Sub ResetConnection()
System.Net.ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf RemoteCertificateValidationCallback)


' Setup the binding with some enlarged buffers for SharePoint
Dim binding = New BasicHttpBinding()

' Change the security mode if we're using http vs https
If (_sharepointUri.Scheme.ToLower() = "http") Then
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly
ElseIf (_sharepointUri.Scheme.ToLower() = "https") Then
binding.Security.Mode = BasicHttpSecurityMode.Transport
Else
Throw New ArgumentException("SharePoint URL Scheme is not recognized: " + _sharepointUri.Scheme)
End If


'@@ binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows
'@@ binding.Security.Transport.ProxyCredentialType = HttpClientCredentialType.Windows
'binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm

' Send credentials and adjust the buffer sizes (SharePoint can send big packets of data)
If (_sharepointUri.Scheme.ToLower() = "http") Then
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm
ElseIf (_sharepointUri.Scheme.ToLower() = "https") Then
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows
binding.Security.Transport.ProxyCredentialType = HttpClientCredentialType.Windows
End If

binding.MaxReceivedMessageSize = Int32.MaxValue
binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue
binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue
binding.ReaderQuotas.MaxDepth = Int32.MaxValue
binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue
binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue


binding.ReceiveTimeout = New TimeSpan(24, 0, 0)

' Create the client with the given settings
Dim ep = New EndpointAddress(_sharepointUri)



' Create the client object
If (Not _sharepointClient Is Nothing) Then
Dim dispose As IDisposable = _sharepointClient
dispose.Dispose()
_sharepointClient = Nothing
End If
_sharepointClient = New ListsSoapClient(binding, ep)

' Only need to add this once, the endpoint will be shared for future instances
Dim clientCredentials As Description.ClientCredentials = _
(From e In _sharepointClient.Endpoint.Behaviors _
Where TypeOf (e) Is Description.ClientCredentials).Single()
clientCredentials.Windows.AllowedImpersonationLevel = _
TokenImpersonationLevel.Impersonation
clientCredentials.Windows.ClientCredential = _credential

End Sub


Naveen Abraham
vtang
vtang
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 15
Do you have any code on Claims Based authentication? I'm receiving

Error System.ServiceModel.Security.MessageSecurityException: The HTTP request was forbidden with client authentication scheme 'Negotiate'. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden. at System.Net.HttpWebRequest.GetResponse() at....



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search