Get current Windows user name within Silverlight

You can manage to get by this way. 1) Create asp.net web service application. 2) Implement web service and method to call from silverlight applicaton. [WebMethod] public string GetClientUserName() { return System.Web.HttpContext.Current.User.Identity.Name.ToString(); } 3) Deploy this web service application on web server. Don’t allow anonymous user to access this. 4) Add this service to Silverlight … Read more

Unable to get windows authentication to work through local IIS

You have to whitelist a domain specified in the hosts file in order for windows authentication to work: Click Start, click Run, type regedit, and then click OK. In Registry Editor, locate the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters Right-click Parameters, click New, and then click DWORD (32-bit) Value. Type DisableStrictNameChecking and press ENTER. Double-click the DisableStrictNameChecking … Read more

The HTTP request is unauthorized with client authentication scheme ‘Ntlm’ The authentication header received from the server was ‘NTLM’

Visual Studio 2005 Create a new console application project in Visual Studio Add a “Web Reference” to the Lists.asmx web service. Your URL will probably look like: http://servername/sites/SiteCollection/SubSite/_vti_bin/Lists.asmx I named my web reference: ListsWebService Write the code in program.cs (I have an Issues list here) Here is the code. using System; using System.Collections.Generic; using System.Text; … Read more

WCFTestClient The HTTP request is unauthorized with client authentication scheme ‘Anonymous’

I didn’t have control over the security configuration for the service I was calling into, but got the same error. I was able to fix my client as follows. In the config, set up the security mode: <security mode=”TransportCredentialOnly”> <transport clientCredentialType=”Windows” proxyCredentialType=”None” realm=”” /> <message clientCredentialType=”UserName” algorithmSuite=”Default” /> </security> In the code, set the proxy … Read more

Using NTLM authentication in Java applications

Out of the above list, only ntlmv2-auth and Jespa support NTLMv2. Jespa is workable but commercial. ntlmv2-auth I haven’t tried but it’s based on the code from Liferay, which I’ve seen working before. ‘ntlm-authentication-in-java’ is only NTLMv1, which is old, insecure, and works in a dwindling number of environments as people upgrade to newer Windows … Read more

NPM behind NTLM proxy

I solved it this way (OS: Windows XP SP3): 1. Download CNTLM installer and run it. 2. Find and fill in these fields in cntlm.ini. Do not fill in the Password field, it’s never a good idea to store unencrypted passwords in text files. Username YOUR_USERNAME Domain YOUR_DOMAIN Proxy YOUR_PROXY_IP:PORT Listen 53128 3. Open console, … Read more

401 response for CORS request in IIS with Windows Auth enabled

You can allow only OPTIONS verb for anonymous users. <system.web> <authentication mode=”Windows” /> <authorization> <allow verbs=”OPTIONS” users=”*”/> <deny users=”?” /> </authorization> </system.web> According W3C specifications, browser excludes user credentials from CORS preflight: https://dvcs.w3.org/hg/cors/raw-file/tip/Overview.html#preflight-request