Domain Login from VB.NET 2005 Windows Application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Domain Login from VB.NET 2005 Windows Application

  1. #1
    Join Date
    Aug 2008
    Location
    Colombo, Sri Lanka
    Posts
    3

    Domain Login from VB.NET 2005 Windows Application

    I do not know whether Iím writing this under the correct topic. Please direct me if Iím wrong. However since the question is for windows application in VB.NET 2005 I thought to put it down here.

    Here is the case;
    I'm developing a windows forms application with vb.net 2005. I have set the authentication mode to windows authentication because I want the application to authenticate with my domain because my SQL database also use windows authentication for domain users. This is perfect as long as I use a domain user account to login into a pc where I need to run this application.

    But let say a situation where I have a laptop which does not use domain login but only local windows login. In this situation I need the application to prompt the domain login box when itís starting. (It is similar to when you configure MS outlook with exchange server.) I know that this can be achieved through ASP.NET. But I need Windows Application to do this task and prompt login box to the domain which I want.

    Can anyone please help me to figure out a solution?

    Thanks in advance.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Welcome to DevX

    Does your web.config have the line:

    set authentication mode = "Windows"
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Aug 2008
    Location
    Colombo, Sri Lanka
    Posts
    3
    Thank you very much for your reply. well web.config required only in ASP.NET. i have no issue with ASP.NET login into the domain. What i do not understand is that in VB.NET Windows Application whether there is a posibility to login in to the domain of choice.....
    Hope you understand my question...
    Thanks a lot.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Well, you wouldn't need VB.NET or any other language to login to your own domain......windows would handle all of that for you.

    So, I have to assume you are looking at logging into a domain in which you are not a member. For that you could try using FTP.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Aug 2008
    Location
    Colombo, Sri Lanka
    Posts
    3
    Thanks for the reply but i think my question was not very clear for u. sorry for that. Let me explain again.

    I'm developing a windows application (not ASP.NET) using VB.NET 2005. The application is configured to use windows authentication. The backend database is located in one of our company servers using SQL 2005. The database is configured to use Active Directory users to login. As you have correctly mentioned our company pcs are member of the company domain. So when I run the application in one of our member PCs it can easily communicate with the sql server and authenticate domain users as the PC is already authenticated via windows login. This part is perfect up to now.

    Let say when i login into the same PC using local pc user instead of using domain user account i still can run the application because application is configured to use windows authentication but it can not communicate with the SQL server because SQL server accepts only domain user accounts to login. So the solution which i see and do not know how to implement is that i need the application to prompt the domain login box when its starting and use the domain user identity as windows identity through out the application.

    Is there anyway that I could program the application to prompt the domain login screen and accept domain user credentials.

    Hope this explanation would be enough to understand my problem. Please let me know if you need more info.

    Thank you in advance.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    As far as I can understand, the problem you are facing is how to run your windows form application using windows authentication.

    I think you can achieve the goal by using Windows impersonation. Here is a KB article about how to implement impersonation. Don't let the fact that the title states in ASP.NET - there are also VB.NET examples given in the article.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  7. #7
    Join Date
    Aug 2008
    Location
    Colombo, Sri Lanka
    Posts
    3
    Hi hack

    I think this is the method i'm looking for. Windows impersonation one of the powerful feature i think in .NET. Thank you very much.

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    You are welcome and I apologize for taking so long to understand what you were asking for.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 12
    Last Post: 01-14-2009, 08:18 AM
  2. SQL server 2005 - No windows connections
    By hospea in forum Database
    Replies: 0
    Last Post: 08-30-2007, 03:40 AM
  3. calling windows application in windows service
    By saileela in forum ASP.NET
    Replies: 0
    Last Post: 01-10-2007, 04:22 AM
  4. ?API NT Compatability?
    By Dennis in forum VB Classic
    Replies: 10
    Last Post: 02-15-2001, 03:52 AM

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