Solved

UGENT, PLEASE HELP - Using Gina to login a user

Posted on 2004-04-17
6
213 Views
Last Modified: 2013-12-04
Im writing a custom Gina,

at the end I want to login username x with password y

how do I tell windows to login this uer, with eir password y?

Is there any extremely easy way? Or maybe a way to capture the UI inout boxs of the original GINA, and overwrite them before the authentication function is actually invoked?

Thanks for any help,
I really appreciate it!
0
Comment
Question by:AruneshGupta
  • 2
6 Comments
 
LVL 7

Expert Comment

by:IceRaven
ID: 10848197
Hi AruneshGupta,

Here is a sample GINA Project

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample98/html/vcsmpginasample.asp

I think LsaLogonUser is used logon user for the system.

Cheers,
IceRaven
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10848848
This is what you need http://beta.experts-exchange.com/Programming/Q_20672582.html
(see the Accepted answer)

Also, some advices about creating a Gina : http://wwwthep.physik.uni-mainz.de/~frink/newgina_pre09/readme.html
0
 

Author Comment

by:AruneshGupta
ID: 10876201
While I could implement the entire W1xLoggedOutSAS function in GINA,
and in the following code fragment:

// Attempt to log on the user.
// Assignments for pwszUser, pwszDomain, and pwszPassword
// handled elsewhere.
  if (!LogonUser(pwszUser,
                 pwszDomain,
                 pwszPassword,
                 LOGON32_LOGON_UNLOCK,
                 LOGON32_PROVIDER_DEFAULT,
                 phToken))
    return WLX_SAS_ACTION_NONE;

send my own pwszUser, pwszPassword

It would be easier if I could just re-assing the above 2 variables somehow, and let the original W1xLogged OutSAS run normally.

Any idea how I might be able to assign/access these variables ?


(P.S.
when i try the msdn sample implementation of this function
it says these 2 variables are assigned elsewhere
and when I try and compile, my code obviously does not find them/compile!
what is goind on?
Also where is the type PG_CONTEXT declared -  my only other compile error.)
0
 
LVL 10

Accepted Solution

by:
Mercantilum earned 500 total points
ID: 10876341
You have actually in your Gina to get this function WlxLoggedOutSas ready when user does ctrl-alt-del.

A nice easy to read implementation of WlxLoggedOutSas
    http://pgina.xpasystems.com/docs/wlxFuncs_8c-source.html

With Explanations
    http://pgina.xpasystems.com/docs/wlxFuncs_8c.html#a4


If you mean to actually bypass Gina and do a kind of "su" (same as unix), you can have a look to "su.c" from cygwin
    http://www.cygwin.com/
Download the file "su.c", it is an implementation of su for Windows.

In this case, you could have 2 users logged in at the same time: one being the desktop one - common one, and the other one, would be, for instance, in a command prompt window, logged in using the code provided by cywgin (su).
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
Security measures require Windows be logged in using Standard User login (not Administrator).  Yet, sometimes an application has to be run “As Administrator” from a Standard User login.  This paper describes how to create a shortcut icon to launch a…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question