views:

110

answers:

1

in vb 2008 express this option is available under application properties. does anyone know what it does? there is also a windows authentication option. what is the difference between these two?

+2  A: 

This setting is specific to VB.NET projects and allows you to change between "Windows" authentication and "Application Defined".

Using the "Windows" authentication setting will ensure your application "picks up" the underlying windows based user credentials (ie. those used to initially log on to Windows itself) and uses those for authentication and authorisation within your application. (i.e. Upon starting your app. the user will usually not have to re-type a username/password combo to gain access to your app.)

Using the "Application Defined" setting will effectively "force" you to supply your own mechanism to authenticate and authorize a user of your application (i.e. Upon starting your app. the user usually WILL have to type a username/password combo to gain access to your app. This could be entirely different from any underlying Windows user credentials and will usually be maintained by you/your application and is usually specific to it).

If you're at all familiar with ASP.NET development, ASP.NET's built-in membership system can switch between "Windows" authentication and "Forms" authentication. These are effectively the same thing but in a web-based context.

The primary reason that this exists as an application setting with a Visual Basic setting, is that the VB-specific "My" namespace contains a "My.User" property, and changes in this setting will affect how the IDE-generated code that provides the "My" namespace will retrieve the user's credentials.

For full information on this, see the MSDN article here:

Application Page, Project Designer (Visual Basic)
(Specifically the section that starts, "Windows Application Framework Properties").

and also here:
How to: Enable Custom User Authentication (Visual Basic)
Walkthrough: Implementing Custom Authentication and Authorization

CraigTP