A more basic question


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: A more basic question

  1. #1
    Join Date
    Jul 2004
    Posts
    30

    Talking A more basic question

    Alright...no takers on my last post so I'll rephrase my question. I need to build an app in VB .Net that requires a login. It would be nice if I could use the windows credentials. Failing that, encryption could also be used. Surely someone has coded this before. I am not interested in ASP.Net, but that is the only information I can locate. If no one has any sample code, could I at least be pointed to a better reference for this than MSDN and Google?

    Thanks in advance!

  2. #2
    Join Date
    Feb 2005
    Posts
    1
    There are a couple of important interfaces you need to look at, IIdentity and IPrincipal. A windows form aplication can get access to a couple of objects (WindowsIdentity & WindowsPrincipal) that you can use to determine if the current user of the app has been authenticated, if so who they are and also through the Pricipal object you can verify group membership. You may find this will give you what you need without writing a logon screen at all. You can check the user is authenticated, check what roles the user has (group membership) and only continue if your requirements are satisfied.
    If you decide to authenticate against some other source you still may want to use the IIdentity and IPricipal interfaces.

    Check out this article http://msdn.microsoft.com/library/de...asp?frame=true

    Hope this helps

  3. #3
    Join Date
    Dec 2003
    Posts
    2,750
    You may be able to perform a bind to Active Directory using Windows credentials and the System.DirectoryServices namespace. There is an example in the following MS KB article:

    http://support.microsoft.com/default...b;en-us;326340
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  4. #4
    Join Date
    Jul 2004
    Posts
    30
    Paul - Is this possible with a windows forms app (and not an asp.net app)?

    Thanks for the great articles!

  5. #5
    Join Date
    Dec 2003
    Posts
    2,750
    Yes, you should still be able to bind with Active Directory. Doesn't matter whether it's an ASP.NET or VB.NET windows application.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center