-
Using Win NT User Name and Password for another App.
Hi !,
Is there any way that I can use Win NT User Name and Password for my VB
Application to login. eg.. like Win NT authentication for SQL server connection.
I want to use the NT User Name and password for my application, so that all
users who have permission to use this NT machine will have access to the
appliaction, by entering thier NT user name and password in the applicaiton's
login screen.
So that I don't have to create a User master in my application's database
and create new users for the application from the application end.
This machine is not connected to the network.
Thanks
Santosh
-
Re: Using Win NT User Name and Password for another App.
You cannot get the password; this would obviously be a security issue.
--
MichKa
Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/
"santosh" <sant99@hotmail.com> wrote in message
news:3c14f745$1@147.208.176.211...
>
> Hi !,
>
> Is there any way that I can use Win NT User Name and Password for my VB
> Application to login. eg.. like Win NT authentication for SQL server
connection.
>
> I want to use the NT User Name and password for my application, so that
all
> users who have permission to use this NT machine will have access to the
> appliaction, by entering thier NT user name and password in the
applicaiton's
> login screen.
>
> So that I don't have to create a User master in my application's database
> and create new users for the application from the application end.
>
> This machine is not connected to the network.
>
>
> Thanks
>
> Santosh
-
Re: Using Win NT User Name and Password for another App.
You cannot get the password; this would obviously be a security issue.
--
MichKa
Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/
"santosh" <sant99@hotmail.com> wrote in message
news:3c14f745$1@147.208.176.211...
>
> Hi !,
>
> Is there any way that I can use Win NT User Name and Password for my VB
> Application to login. eg.. like Win NT authentication for SQL server
connection.
>
> I want to use the NT User Name and password for my application, so that
all
> users who have permission to use this NT machine will have access to the
> appliaction, by entering thier NT user name and password in the
applicaiton's
> login screen.
>
> So that I don't have to create a User master in my application's database
> and create new users for the application from the application end.
>
> This machine is not connected to the network.
>
>
> Thanks
>
> Santosh
-
Re: Using Win NT User Name and Password for another App.
You can't retrieve a user's password, but you can authenticate the user by
using the LogonUser API function. This takes the user name and text password.
If the function succeeds, the password was correct.
This can also be done to impersonate the user's credentials in order to access
resources and system objects. However, if this is your intent, i suggest
you do a search on Impersonation in the MSDN to learn some of the more intricate
details.
-Rob
"santosh" <sant99@hotmail.com> wrote:
>
>Hi !,
>
>Is there any way that I can use Win NT User Name and Password for my VB
>Application to login. eg.. like Win NT authentication for SQL server connection.
>
>I want to use the NT User Name and password for my application, so that
all
>users who have permission to use this NT machine will have access to the
>appliaction, by entering thier NT user name and password in the applicaiton's
>login screen.
>
>So that I don't have to create a User master in my application's database
>and create new users for the application from the application end.
>
>This machine is not connected to the network.
>
>
>Thanks
>
>Santosh
-
Re: Using Win NT User Name and Password for another App.
You can't retrieve a user's password, but you can authenticate the user by
using the LogonUser API function. This takes the user name and text password.
If the function succeeds, the password was correct.
This can also be done to impersonate the user's credentials in order to access
resources and system objects. However, if this is your intent, i suggest
you do a search on Impersonation in the MSDN to learn some of the more intricate
details.
-Rob
"santosh" <sant99@hotmail.com> wrote:
>
>Hi !,
>
>Is there any way that I can use Win NT User Name and Password for my VB
>Application to login. eg.. like Win NT authentication for SQL server connection.
>
>I want to use the NT User Name and password for my application, so that
all
>users who have permission to use this NT machine will have access to the
>appliaction, by entering thier NT user name and password in the applicaiton's
>login screen.
>
>So that I don't have to create a User master in my application's database
>and create new users for the application from the application end.
>
>This machine is not connected to the network.
>
>
>Thanks
>
>Santosh
-
Re: Using Win NT User Name and Password for another App.
As Rob says, you can impersonate the subject user. This has some requirements,
however, such as the caller holding the SeTcbPrivilege privilege, which is
not automatically granted to administrators.
Here is some code to perform impersonation:
http://killervb.com/functionJunction...personator.cls
Here is some code to enable privileges:
http://killervb.com/functionJunction...privileges.bas
Monte Hansen
http://KillerVB.com
"santosh" <sant99@hotmail.com> wrote:
>
>Hi !,
>
>Is there any way that I can use Win NT User Name and Password for my VB
>Application to login. eg.. like Win NT authentication for SQL server connection.
>
>I want to use the NT User Name and password for my application, so that
all
>users who have permission to use this NT machine will have access to the
>appliaction, by entering thier NT user name and password in the applicaiton's
>login screen.
>
>So that I don't have to create a User master in my application's database
>and create new users for the application from the application end.
>
>This machine is not connected to the network.
>
>
>Thanks
>
>Santosh
-
Re: Using Win NT User Name and Password for another App.
As Rob says, you can impersonate the subject user. This has some requirements,
however, such as the caller holding the SeTcbPrivilege privilege, which is
not automatically granted to administrators.
Here is some code to perform impersonation:
http://killervb.com/functionJunction...personator.cls
Here is some code to enable privileges:
http://killervb.com/functionJunction...privileges.bas
Monte Hansen
http://KillerVB.com
"santosh" <sant99@hotmail.com> wrote:
>
>Hi !,
>
>Is there any way that I can use Win NT User Name and Password for my VB
>Application to login. eg.. like Win NT authentication for SQL server connection.
>
>I want to use the NT User Name and password for my application, so that
all
>users who have permission to use this NT machine will have access to the
>appliaction, by entering thier NT user name and password in the applicaiton's
>login screen.
>
>So that I don't have to create a User master in my application's database
>and create new users for the application from the application end.
>
>This machine is not connected to the network.
>
>
>Thanks
>
>Santosh
-
Re: Using Win NT User Name and Password for another App.
So you say, Michael, but that's not your call to make. The need for batch
impersonation exists, as is the ability to perform it; and so I submit:
U-R-W-R-O-N-G !
Monte Hansen
http://KillerVB.com
"Michael \(michka\) Kaplan" <former_mvp@nospam.trigeminal.spamless.com> wrote:
>Anyone with an app that does this should be taken out and shot.
>
>Why would anyone want to trust their password to any app OTHER than the
OS
>logon service?
>
>
>--
>MichKa
>
>Michael Kaplan
>(principal developer of the MSLU)
>Trigeminal Software, Inc. -- http://www.trigeminal.com/
>the book -- http://www.i18nWithVB.com/
>
>
>"Rob Teixeira" <RobTeixeira@@msn.com> wrote in message
>news:3c1518c0$1@147.208.176.211...
>>
>>
>> You can't retrieve a user's password, but you can authenticate the user
by
>> using the LogonUser API function. This takes the user name and text
>password.
>> If the function succeeds, the password was correct.
>>
>> This can also be done to impersonate the user's credentials in order to
>access
>> resources and system objects. However, if this is your intent, i suggest
>> you do a search on Impersonation in the MSDN to learn some of the more
>intricate
>> details.
>>
>> -Rob
>>
>> "santosh" <sant99@hotmail.com> wrote:
>> >
>> >Hi !,
>> >
>> >Is there any way that I can use Win NT User Name and Password for my
VB
>> >Application to login. eg.. like Win NT authentication for SQL server
>connection.
>> >
>> >I want to use the NT User Name and password for my application, so that
>> all
>> >users who have permission to use this NT machine will have access to
the
>> >appliaction, by entering thier NT user name and password in the
>applicaiton's
>> >login screen.
>> >
>> >So that I don't have to create a User master in my application's database
>> >and create new users for the application from the application end.
>> >
>> >This machine is not connected to the network.
>> >
>> >
>> >Thanks
>> >
>> >Santosh
>>
>
>
-
Re: Using Win NT User Name and Password for another App.
So you say, Michael, but that's not your call to make. The need for batch
impersonation exists, as is the ability to perform it; and so I submit:
U-R-W-R-O-N-G !
Monte Hansen
http://KillerVB.com
"Michael \(michka\) Kaplan" <former_mvp@nospam.trigeminal.spamless.com> wrote:
>Anyone with an app that does this should be taken out and shot.
>
>Why would anyone want to trust their password to any app OTHER than the
OS
>logon service?
>
>
>--
>MichKa
>
>Michael Kaplan
>(principal developer of the MSLU)
>Trigeminal Software, Inc. -- http://www.trigeminal.com/
>the book -- http://www.i18nWithVB.com/
>
>
>"Rob Teixeira" <RobTeixeira@@msn.com> wrote in message
>news:3c1518c0$1@147.208.176.211...
>>
>>
>> You can't retrieve a user's password, but you can authenticate the user
by
>> using the LogonUser API function. This takes the user name and text
>password.
>> If the function succeeds, the password was correct.
>>
>> This can also be done to impersonate the user's credentials in order to
>access
>> resources and system objects. However, if this is your intent, i suggest
>> you do a search on Impersonation in the MSDN to learn some of the more
>intricate
>> details.
>>
>> -Rob
>>
>> "santosh" <sant99@hotmail.com> wrote:
>> >
>> >Hi !,
>> >
>> >Is there any way that I can use Win NT User Name and Password for my
VB
>> >Application to login. eg.. like Win NT authentication for SQL server
>connection.
>> >
>> >I want to use the NT User Name and password for my application, so that
>> all
>> >users who have permission to use this NT machine will have access to
the
>> >appliaction, by entering thier NT user name and password in the
>applicaiton's
>> >login screen.
>> >
>> >So that I don't have to create a User master in my application's database
>> >and create new users for the application from the application end.
>> >
>> >This machine is not connected to the network.
>> >
>> >
>> >Thanks
>> >
>> >Santosh
>>
>
>
-
Re: Using Win NT User Name and Password for another App.
"Michael \(michka\) Kaplan" <former_mvp@nospam.trigeminal.spamless.com> wrote:
>Anyone with an app that does this should be taken out and shot.
>
I won't go that far, since I don't know the extent of his program's requirements.
However...
I find it highly suspect that one would need to logon to the OS, then logon
*again* to the application (on the same computer, in the same session). In
a typical corporate environment, this is definitely not the norm operating
procedure, and I'd suggest rethinking the approach if that were the case.
>Why would anyone want to trust their password to any app OTHER than the
OS
>logon service?
People do it all the time. Web app in IE with NT authentication is a good
example. Also, running certain admin apps within a non-admin session queries
for logon information as well.
Again, due to the nature of what he mentioned earlier, I'd be inclined to
advise a review of the aproach, but if that's what he needs, then so be it.
What may be more appropriate in this scenario (especially since this app
is dealing only with local accounts), is for him to use ADSI (or advapi)
and look at the currently logged on user. He can then enumerate the user's
group membership to see if the user belongs to an "approved" group, rather
than having the user logon again within the application.
-Rob
-
Re: Using Win NT User Name and Password for another App.
"Michael \(michka\) Kaplan" <former_mvp@nospam.trigeminal.spamless.com> wrote:
>Anyone with an app that does this should be taken out and shot.
>
I won't go that far, since I don't know the extent of his program's requirements.
However...
I find it highly suspect that one would need to logon to the OS, then logon
*again* to the application (on the same computer, in the same session). In
a typical corporate environment, this is definitely not the norm operating
procedure, and I'd suggest rethinking the approach if that were the case.
>Why would anyone want to trust their password to any app OTHER than the
OS
>logon service?
People do it all the time. Web app in IE with NT authentication is a good
example. Also, running certain admin apps within a non-admin session queries
for logon information as well.
Again, due to the nature of what he mentioned earlier, I'd be inclined to
advise a review of the aproach, but if that's what he needs, then so be it.
What may be more appropriate in this scenario (especially since this app
is dealing only with local accounts), is for him to use ADSI (or advapi)
and look at the currently logged on user. He can then enumerate the user's
group membership to see if the user belongs to an "approved" group, rather
than having the user logon again within the application.
-Rob
-
Re: Using Win NT User Name and Password for another App.
> I want to use the NT User Name and password for my application, so that all
> users who have permission to use this NT machine will have access to the
> appliaction, by entering thier NT user name and password in the applicaiton's
> login screen.
Why do you want to check the permission once again when it is
checked already by Windows?
Juergen.
-
Re: Using Win NT User Name and Password for another App.
> I want to use the NT User Name and password for my application, so that all
> users who have permission to use this NT machine will have access to the
> appliaction, by entering thier NT user name and password in the applicaiton's
> login screen.
Why do you want to check the permission once again when it is
checked already by Windows?
Juergen.
-
Re: Using Win NT User Name and Password for another App.
Anyone with an app that does this should be taken out and shot.
Why would anyone want to trust their password to any app OTHER than the OS
logon service?
--
MichKa
Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/
"Rob Teixeira" <RobTeixeira@@msn.com> wrote in message
news:3c1518c0$1@147.208.176.211...
>
>
> You can't retrieve a user's password, but you can authenticate the user by
> using the LogonUser API function. This takes the user name and text
password.
> If the function succeeds, the password was correct.
>
> This can also be done to impersonate the user's credentials in order to
access
> resources and system objects. However, if this is your intent, i suggest
> you do a search on Impersonation in the MSDN to learn some of the more
intricate
> details.
>
> -Rob
>
> "santosh" <sant99@hotmail.com> wrote:
> >
> >Hi !,
> >
> >Is there any way that I can use Win NT User Name and Password for my VB
> >Application to login. eg.. like Win NT authentication for SQL server
connection.
> >
> >I want to use the NT User Name and password for my application, so that
> all
> >users who have permission to use this NT machine will have access to the
> >appliaction, by entering thier NT user name and password in the
applicaiton's
> >login screen.
> >
> >So that I don't have to create a User master in my application's database
> >and create new users for the application from the application end.
> >
> >This machine is not connected to the network.
> >
> >
> >Thanks
> >
> >Santosh
>
-
Re: Using Win NT User Name and Password for another App.
Anyone with an app that does this should be taken out and shot.
Why would anyone want to trust their password to any app OTHER than the OS
logon service?
--
MichKa
Michael Kaplan
(principal developer of the MSLU)
Trigeminal Software, Inc. -- http://www.trigeminal.com/
the book -- http://www.i18nWithVB.com/
"Rob Teixeira" <RobTeixeira@@msn.com> wrote in message
news:3c1518c0$1@147.208.176.211...
>
>
> You can't retrieve a user's password, but you can authenticate the user by
> using the LogonUser API function. This takes the user name and text
password.
> If the function succeeds, the password was correct.
>
> This can also be done to impersonate the user's credentials in order to
access
> resources and system objects. However, if this is your intent, i suggest
> you do a search on Impersonation in the MSDN to learn some of the more
intricate
> details.
>
> -Rob
>
> "santosh" <sant99@hotmail.com> wrote:
> >
> >Hi !,
> >
> >Is there any way that I can use Win NT User Name and Password for my VB
> >Application to login. eg.. like Win NT authentication for SQL server
connection.
> >
> >I want to use the NT User Name and password for my application, so that
> all
> >users who have permission to use this NT machine will have access to the
> >appliaction, by entering thier NT user name and password in the
applicaiton's
> >login screen.
> >
> >So that I don't have to create a User master in my application's database
> >and create new users for the application from the application end.
> >
> >This machine is not connected to the network.
> >
> >
> >Thanks
> >
> >Santosh
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks