When I tried to access it using Client Object Model with my NTLM credentials I got 401 (Unauthorized) exception. I googled and found this solution
...
clientContext.ExecutingWebRequest += new EventHandler(clientContext_ExecutingWebRequest);
...
}
static void clientContext_ExecutingWebRequest(object sender, WebRequestEventArgs e)
{
e.WebRequestExecutor.WebRequest.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
}
This works well for me.
Then when I tried to access same site using Lists.asmx web service with same NTLM credentials I got exactly same exception.
I added this method to the Web Service wrapper class (it's in Web References > ListWebService > Reference.map > Reference.cs in my case)
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.WebRequest wr = base.GetWebRequest(uri);
wr.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
return wr;
}
That solved the issue as well.
Thanks for posting! This just solved my problem that I had. See http://sharepoint.stackexchange.com/questions/14130/how-do-i-avoid-redirection-for-web-service-authentication-in-sharepoint-2010-when/14132#14132 for details.
ReplyDeleteMachine Learning Projects for Final Year machine learning projects for final year
DeleteDeep Learning Projects assist final year students with improving your applied Deep Learning skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include Deep Learning projects for final year into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Deep Learning Projects for Final Year even arrange a more significant compensation.
Python Training in Chennai Python Training in Chennai Angular Training Project Centers in Chennai
Thanks a lot!! This too solved my problem !!!
ReplyDeleteHello, great post and it solves my problem partially.
ReplyDeleteI still get the same error when I try to connect from within a SharePoint Custom web service to another SharePoint Custom web service.
The first web service is called from a Windows Service or from a Windows application. Within the first web service the authentication is working fine and I can get the SPContext.Current.Web.CurrentUser property correctly.
When I try to access another custom made SharePoint webservice within the ISAPI folder I can not get the SPContext.Current.Web.CurrentUser property while it is NULL.
Both web services are extended with the GetWebRequest override.
Do you know what I am missing?
Thanks in advance!
Problem solved by adding the following piece of code to the initialization of the web service:
ReplyDelete//Check if a HttpContext exists. When calling this from a console app this will be null and settings cookie is not neccessary.
HttpContext CurrentContext = HttpContext.Current;
if (CurrentContext != null)
{
myPermissionService.CookieContainer = new System.Net.CookieContainer();
HttpCookie authCookie = CurrentContext.Request.Cookies["FedAuth"];
if (authCookie != null)
{
//when the service is requested anonymously, for example to recover a password, the forms auth cookie will not exist
myPermissionService.CookieContainer.Add(new Cookie("FedAuth", authCookie.Value, authCookie.Path, CurrentContext.Request.Url.Host));
}
}
Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle.
ReplyDeleteIsoft Innovations Company Address
Isoft Innovations Facebook
coin haber - koin haber - kripto para haberleri - coin haber - instagram video indir - instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir - instagram takipçi satın al
ReplyDeleteaşk kitapları
ReplyDeleteyoutube abone satın al
takipçi satın al
takipçi satın al
takipçi satın al
takipcialdim.com/tiktok-takipci-satin-al/
instagram beğeni satın al
beğeni satın al
btcturk
tiktok izlenme satın al
sms onay
youtube izlenme satın al
tiktok jeton hilesi
tiktok beğeni satın al
takipçi satın al
uc satın al
sms onay
sms onay
tiktok takipçi satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
instagram beğeni satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
takipcialdim.com/instagram-begeni-satin-al/
perde modelleri
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
betboo
marsbahis
sultanbet
takipçi satın al
ReplyDeleteinstagram takipçi satın al
https://www.takipcikenti.com
www.escortsmate.com
ReplyDeleteescortsmate.com
https://www.escortsmate.com
marsbahis
ReplyDeletebetboo
sultanbet
marsbahis
betboo
sultanbet
ucuz takipçi
ReplyDeleteucuz takipçi
tiktok izlenme satın al
binance güvenilir mi
okex güvenilir mi
paribu güvenilir mi
bitexen güvenilir mi
coinbase güvenilir mi
instagram takipçi satın al
marsbahis
ReplyDeletetrendbet
galabet thanks yees
I can’t thank you enough. دانلود آهنگ
ReplyDeletetiktok jeton hilesi
ReplyDeletetiktok jeton hilesi
referans kimliği nedir
gate güvenilir mi
tiktok jeton hilesi
paribu
btcturk
bitcoin nasıl alınır
yurtdışı kargo
seo fiyatları
ReplyDeletesaç ekimi
dedektör
instagram takipçi satın al
ankara evden eve nakliyat
fantezi iç giyim
sosyal medya yönetimi
mobil ödeme bozdurma
kripto para nasıl alınır
bitcoin nasıl alınır
ReplyDeletetiktok jeton hilesi
youtube abone satın al
gate io güvenilir mi
referans kimliği nedir
tiktok takipçi satın al
bitcoin nasıl alınır
mobil ödeme bozdurma
mobil ödeme bozdurma
Fon perde modelleri
ReplyDeletemobil onay
TÜRK TELEKOM MOBİL ÖDEME BOZDURMA
nft nasil alinir
ANKARA EVDEN EVE NAKLİYAT
TRAFİK SİGORTASİ
dedektör
web sitesi kurma
aşk kitapları
smm panel
ReplyDeletesmm panel
İs ilanlari
İnstagram Takipçi Satın Al
https://www.hirdavatciburada.com
HTTPS://WWW.BEYAZESYATEKNİKSERVİSİ.COM.TR
Servis
Jeton Hilesi İndir