Authenticating Username & Password


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Authenticating Username & Password

  1. #1
    Johan Guest

    Authenticating Username & Password


    Hi All,

    I want to use NT authentication in one of my projects, but I'm having trouble
    determining whether the entered Username & Password is valid for the current
    domain. The app requires a user to enter a Username & Password every time
    a certain task is executed and different users will operate the app on the
    same machine.

    I have no problem getting the user info with 'NetUserGetInfo' in 'netapi32',
    but I can't determine whether it's a valid password or not. The password
    returned from the USER_INFO_EXT_API type is blank - for obvious reasons

    Can anybody tell me how to take a Username and Password and authenticate
    it on the current domain ?

    TIA
    Johan

  2. #2
    Monte Hansen Guest

    Re: Authenticating Username & Password

    You can use LogonUser, which requires the SE_TCB_NAME privilege. This
    privilege must be manually added as it is not granted to anyone by default,
    not event an Administrator.

    +|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+
    Monte Hansen
    http://KillerVB.com
    +|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+


    "Johan" <johan.grobler@ensemble.co.za> wrote in message
    news:3af27b31$1@news.devx.com...
    >
    > Hi All,
    >
    > I want to use NT authentication in one of my projects, but I'm having

    trouble
    > determining whether the entered Username & Password is valid for the

    current
    > domain. The app requires a user to enter a Username & Password every time
    > a certain task is executed and different users will operate the app on the
    > same machine.
    >
    > I have no problem getting the user info with 'NetUserGetInfo' in

    'netapi32',
    > but I can't determine whether it's a valid password or not. The password
    > returned from the USER_INFO_EXT_API type is blank - for obvious reasons
    >
    > Can anybody tell me how to take a Username and Password and authenticate
    > it on the current domain ?
    >
    > TIA
    > Johan




  3. #3
    Monte Hansen Guest

    Re: Authenticating Username & Password

    You can use LogonUser, which requires the SE_TCB_NAME privilege. This
    privilege must be manually added as it is not granted to anyone by default,
    not event an Administrator.

    +|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+
    Monte Hansen
    http://KillerVB.com
    +|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+


    "Johan" <johan.grobler@ensemble.co.za> wrote in message
    news:3af27b31$1@news.devx.com...
    >
    > Hi All,
    >
    > I want to use NT authentication in one of my projects, but I'm having

    trouble
    > determining whether the entered Username & Password is valid for the

    current
    > domain. The app requires a user to enter a Username & Password every time
    > a certain task is executed and different users will operate the app on the
    > same machine.
    >
    > I have no problem getting the user info with 'NetUserGetInfo' in

    'netapi32',
    > but I can't determine whether it's a valid password or not. The password
    > returned from the USER_INFO_EXT_API type is blank - for obvious reasons
    >
    > Can anybody tell me how to take a Username and Password and authenticate
    > it on the current domain ?
    >
    > TIA
    > Johan




  4. #4
    L.J. Johnson Guest

    Re: Authenticating Username & Password

    Johan,

    http://gethelp.devx.com/techtips/nt_.../10min0498.asp
    http://gethelp.devx.com/techtips/nt_.../10min0598.asp

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>

    "Johan" <johan.grobler@ensemble.co.za> wrote in message
    news:3af27b31$1@news.devx.com...
    >
    > Hi All,
    >
    > I want to use NT authentication in one of my projects, but I'm having

    trouble
    > determining whether the entered Username & Password is valid for the

    current
    > domain. The app requires a user to enter a Username & Password every time
    > a certain task is executed and different users will operate the app on the
    > same machine.
    >
    > I have no problem getting the user info with 'NetUserGetInfo' in

    'netapi32',
    > but I can't determine whether it's a valid password or not. The password
    > returned from the USER_INFO_EXT_API type is blank - for obvious reasons
    >
    > Can anybody tell me how to take a Username and Password and authenticate
    > it on the current domain ?
    >
    > TIA
    > Johan




  5. #5
    L.J. Johnson Guest

    Re: Authenticating Username & Password

    Johan,

    http://gethelp.devx.com/techtips/nt_.../10min0498.asp
    http://gethelp.devx.com/techtips/nt_.../10min0598.asp

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>

    "Johan" <johan.grobler@ensemble.co.za> wrote in message
    news:3af27b31$1@news.devx.com...
    >
    > Hi All,
    >
    > I want to use NT authentication in one of my projects, but I'm having

    trouble
    > determining whether the entered Username & Password is valid for the

    current
    > domain. The app requires a user to enter a Username & Password every time
    > a certain task is executed and different users will operate the app on the
    > same machine.
    >
    > I have no problem getting the user info with 'NetUserGetInfo' in

    'netapi32',
    > but I can't determine whether it's a valid password or not. The password
    > returned from the USER_INFO_EXT_API type is blank - for obvious reasons
    >
    > Can anybody tell me how to take a Username and Password and authenticate
    > it on the current domain ?
    >
    > TIA
    > Johan




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