.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

hardcode windows auth- UN/PW

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net

I know this is a poor idea, but it is meerly a starting point for me.

How can I hardcode  and pass the username / password information in an httpmodule (c#) for a windows based authentication app?

I.E i want to get to a site where i would normally need to enter username and password because authentication is set to windows, but i dont need to enter it because a httpmod is automatically passing the credentials along and i automatically get in.


View Complete Post

More Related Resource Links

SQL changes from Mixed to Windows auth mode after SQL updates

We run a SQL 2005 cluster on Windows 2008 in Mixed authentication mode.  The last two times we have applied a SQL security patch, it automatically changed the auth mode from Mixed to Windows-only, taking our applications offline.  Most recently was today, when we applied KB970892. Can someone explain why this is happening and how we can prevent it?

Windows Auth Web App extended to FBA, and only one web app at a time is allowing SSL

I had a farm with about 6 web applications, all using SSL. I just created another web app and extended it to use FBA. I attach a self-signed cert until its ready for prod (in IIS 6 using SelfSSL.exe), both web apps have dedicated IP's, which set under the WebSite tab in the site's properties, as well as "Multiple SSL identities for this Web Site" and the host header is listed above that in "Multiple identities for this web site" and both are listed as having the https:// protocol in Alternate Access Mapping in Central Admin. Everything is set to use port 443, both in Sharepoint and in IIS. But only one of these two web apps will allow an SSL connection at the same time, I can get SSL to work on either one individually, but as soon as I can hit the site with https:// protocol, the other site stops working with SSL, yet can be hit with the http:// protocol. what gives? Thanks

Windows Auth - still showing login prompt in IE...

Hi, I'm trying to setup my IIS 7.0 MVC2 site but having problems. I want to use Integrated Security so that the app can obtain the user's credentials. We can then do a look-up of some AD groups to determine what they can do from that point onwards. The problem is - Every time we browse to the application, instead of navigating to our main page immediately, we get a login prompt provided by IE. I've read that we need to make sure that in the browser's Tools->Options->Advanced-> (Securiy-> ENable Windows Intagrated Security) must be checked - which it is on ALL 3 machines where I try this. The machines AND the server are all in the same domain. My config file states <authentication mode="Windows" /> and I've tried every combination for <identity...> and <authorization...> but to no avail. I can only get the "login" prompt to go away if I enable Anonymous Authentication - but then I can't detect the windows user or their group membership. What is causing the perpetual display of the login prompt - Its driving me mad ! Help...

what are valid client credentials in windows auth?

I just finished configuring a service to use net.tcp binding and use security mode of Transport with Windows creds.  Previously I had been using security mode none, but I'm trying to improve things. So this works for client computers that are members of my domain.  But when I try to launch the client on a computer using a local account login that is not a member of the domain, I get "The server has rejected the client credentials". In order for "Transport" mode "Windows" credentials to work, do all clients have to be run from domain authenticated workstations? How can I get my client to run from this non-domain computer?  Its on the same network, but not a member of the domain. -Ethan Nelson

Differentiate between Windows Auth and Forms Auth users when authenticating against same AD with Sha

I am currently working on a SharePoint 2010 project where the environment is setup with a SharePoint web application using claims based authentication. The web app is created on port 8081 using Windows Authentication for auth, and extended to port 80 using Forms Based Authentication.

The forms authentication provider is setup to use the same active directory as the windows auth based site, using the following entries in the application's web.config (the entries are in the central administration and security token service web.config files as well):

        <membership defaultProvider="i">
        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add name="FBA_AD_MP" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADFBAConnectionString" enableSearchMethods="true" attributeMapUsername="userPrincipalName" />

Problem with Sharepoint 2010 - Claims Auth - Windows Auth and FBA. consistent redirects back to "cho


We have sharepoint 2010 foundation site that we can successfully login with via IE, Firefox, Chrome both on the domain and externally with Claims Authentication with only Windows Auth type selected (NTLM).

Once we add FBA and use the default signin page, we can still login (we select Windows Auth from the dropdown) BUT it only works on the domain. When we try to access externally, the only browser that works is FireFox. Both Chrome and IE just constantly redirect back to the Choose Authentication dropdown screen.

We have tried for the last 2 days to sort this out. Has anyone else experience this? It looks like the default sign in page somehow doesn't set the cookie for IE and Chrome and just bounces us back to the sign in page...

Thanks for any info...

To clarify, we are not even using the FBA yet. We are trying to login only with the windows auth and domain accounts...

MVC asp.net profile providor windows auth



 I have a MVC 2 application, that I setup with my SqlProfileProvider(setup with and already working with asp.net 2 apps)  for user profile.  I use Active Directory for my user makes with windows authentication but when I try to view the users profile setting I am getting "This property cannot be set for anonymous users."  My question is Why?   With MVC I call the command for 

httpContext.Current.User.Identity.Name and I get my domain/user name.  So I am not sure what step I am missing, is there something special i have to do for MVCX


WCF Windows Auth (NTLM) Problem when Client and Server are on the same machine


I have WCF service being hosted in IIS with windows auth enabled, it is running under NetworkService account .  I have a simple method on my WCF service which just reflects the identity of who is calling it.


public string RefelctIdentity()



return HttpContext.Current.User.Identity.Name;


I am using IIS to authenticate the user and pass me the WindowsPrincipal in the HTTP context.

I am consuming the WCF service witha client used in a WindowsService that is being run under the NetworkService account.  When the WindowsService.  When running b

MS JDBC (3.0) with Windows Auth from oSX or Linux

Is this even possbile: MS JDBC (3.0) with Windows Auth from oSX or Linux ? It works for other JDBC drivers (data direct, jTDS) but I am unable to find a solution using MS  JDBC. We're using advanced features of SQL Server that don't work right with the other drivers yet, MS JDBC does not seem to support windows auth from a non-windows client (the other drivers do).
Jeff Block t:@sqlDictum (http://www.twitter.com/sqlDictum)

Change in Windows Auth between SQL 2005 and SQL 2008, bug?


Since upgrading some clients to SQL 2008 I am running into a problem with laptops that are members of a domain and using Windows Authentication while not connected to the domain.

The users are receiving errors:

The Local Security Authority cannot be contacted
Cannot generate SSPI context


I see many write ups on this in the SQL Forums and other places on the Internet.


My question is, is this a bug? If I use osql.exe as a test there is a distinct difference between SQL 2008 and SQL 2005.

I can use osql.exe from 90\tools\binn (SQL 2005) with the following command while not connected to the domain and it connects to either my SQL 2005 or 2008 instance.

osql -E -S <server>\<instance>

However, the exact same command using osql.exe from 100\tools\binn (SQL 2008) fails and generates the errors above.

My application is receiving the same error. It is using a DSN-less ODBC connection.


This is running XP SP3 and SQL 2008 Express SP1.

I'm trying to determine if this is a bug that may be fixed or if it is just life now and I need to adjust.





Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Serving Silverlight Apps from Windows Mobile

Even if mobile dev is not my every day work, thanks to the .Net Compact Framework, it's still .Net programming.

Here is the scenario:

You come back home, you have a windows mobile phone wifi capable and you want to quickly get access to your phone pictures from your home network.
You just activate the Wifi, run my app and then browse to the provided link from any computer on the network.

Getting Started with Windows SharePoint Services

Of all of the capabilities of SharePoint, I thought I would start with the most basic installation - as a corporate intranet. It is likely that we will need to discuss some of the elements of SharePoint as we go along, so this also gives us the opportunity to review these elements for future reference.

Before going into too much detail, I would like to point out that you can try the core SharePoint framework (known as Windows SharePoint Services or WSS) for free. On Microsoft's Web site you can download a trial version of Virtual PC 2004 (VPC). Using VPC, you can install the Windows 2003 Evaluation Kit and the WSS add-on. This combination will give you 45 days to evaluate the setup.

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Getting Started with Windows Communication Foundation

Windows Communication Foundation (WCF) provides a unified framework for rapidly building service-oriented applications that makes it easy to build and consume secure, reliable, and transacted Web services. It unifies the capabilities in ASMX, WSE, Remoting, COM+, and MSMQ; therefore developers need to learn only one programming model.

Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend