diff -ur xdm-1.0.5/config/Xresources.cpp xdm-1.0.5_bio-clean/config/Xresources.cpp
--- xdm-1.0.5/config/Xresources.cpp	2004-04-23 12:54:43.000000000 -0700
+++ xdm-1.0.5_bio-clean/config/Xresources.cpp	2006-09-15 17:20:35.000000000 -0700
@@ -27,6 +27,7 @@
 xlogin*namePrompt: \040\040\040\040\040\040\040Login:
 #endif /* XPM */
 xlogin*fail: Login incorrect
+xlogin*alternativeAuth: 0
 #ifdef XPM
 XHASHif WIDTH > 800
 xlogin*greetFont: -adobe-helvetica-bold-o-normal--24-240-75-75-p-138-iso8859-1
@@ -78,6 +79,7 @@
 xlogin*useShape: true
 xlogin*logoPadding: 10
 #endif /* XPM */
+xlogin*alternativeAuth: false
 
 XConsole.text.geometry:	480x130
 XConsole.verbose:	true
diff -ur xdm-1.0.5/dm.h xdm-1.0.5_bio-clean/dm.h
--- xdm-1.0.5/dm.h	2005-11-07 22:33:31.000000000 -0800
+++ xdm-1.0.5_bio-clean/dm.h	2006-09-15 17:20:35.000000000 -0700
@@ -275,6 +275,7 @@
 	/* add new fields below this line, and preferably at the end */
 	Boolean		allow_null_passwd; /* allow null password on login */
 	Boolean		allow_root_login; /* allow direct root login */
+	Boolean		allow_pam_first; /* allow direct call of PAM without entering username and password */
 };
 
 typedef void (*ChooserFunc)(CARD16 connectionType, ARRAY8Ptr addr, char *closure);
diff -ur xdm-1.0.5/greeter/Login.c xdm-1.0.5_bio-clean/greeter/Login.c
--- xdm-1.0.5/greeter/Login.c	2006-04-13 19:52:02.000000000 -0700
+++ xdm-1.0.5_bio-clean/greeter/Login.c	2006-09-15 17:20:35.000000000 -0700
@@ -121,6 +121,11 @@
 /* end (amit) */
 #endif /* XPM */
 
+/* added by Josef Hajas */
+        {XtNalternativeAuth, XtCAlternativeAuth, XtRBoolean, sizeof(Boolean),
+        offset(alternativeAuth), XtRImmediate, (XtPointer) False},
+/* end (josef) */
+    
     {XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
     	offset (font), XtRString,	"*-new century schoolbook-medium-r-normal-*-180-*"},
     {XtNpromptFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
diff -ur xdm-1.0.5/greeter/Login.h xdm-1.0.5_bio-clean/greeter/Login.h
--- xdm-1.0.5/greeter/Login.h	2004-04-23 12:54:43.000000000 -0700
+++ xdm-1.0.5_bio-clean/greeter/Login.h	2006-09-15 17:20:35.000000000 -0700
@@ -112,6 +112,9 @@
 # define XtCAllowNullPasswd	"AllowNullPasswd"
 # define XtCAllowRootLogin	"AllowRootLogin"
 
+#define XtNalternativeAuth "alternativeAuth"
+#define XtCAlternativeAuth "AlternativeAuth"
+
 /* notifyDone interface definition */
 
 #ifdef __OpenBSD__
diff -ur xdm-1.0.5/greeter/LoginP.h xdm-1.0.5_bio-clean/greeter/LoginP.h
--- xdm-1.0.5/greeter/LoginP.h	2004-04-23 12:54:43.000000000 -0700
+++ xdm-1.0.5_bio-clean/greeter/LoginP.h	2006-09-15 17:20:35.000000000 -0700
@@ -90,6 +90,7 @@
 	Boolean		allow_null_passwd; /* allow null password on login */
 	Boolean		allow_root_login; /* allow root login */
 	XIC		xic;		/* input method of input context */
+        Boolean 	alternativeAuth;/* biometrics support */
 #ifdef XPM
 	/*caolan begin*/
 	int lastEventTime;
diff -ur xdm-1.0.5/greeter/greet.c xdm-1.0.5_bio-clean/greeter/greet.c
--- xdm-1.0.5/greeter/greet.c	2005-08-18 21:26:04.000000000 -0700
+++ xdm-1.0.5_bio-clean/greeter/greet.c	2006-09-15 17:20:35.000000000 -0700
@@ -298,9 +298,9 @@
 
     XtSetArg (arglist[0], XtNallowAccess, False);
     XtSetValues (login, arglist, 1);
-
     Debug ("dispatching %s\n", d->name);
-    done = 0;
+    
+    done = greet->allow_pam_first;
     while (!done) {
 	XtAppNextEvent (context, &event);
 	switch (event.type) {
@@ -357,6 +357,7 @@
     DrawFail (login);
     bzero (greet->name, strlen(greet->name));
     bzero (greet->password, strlen(greet->password));
+    greet->allow_pam_first = 0;
 }
 
 
@@ -368,6 +369,7 @@
     struct dlfuncs        *dlfuncs)
 {
     int i;
+    Arg		arglist[1];
 
 #ifdef GREET_LIB
 /*
@@ -423,6 +425,9 @@
 #ifdef __OpenBSD__
     openlog("xdm", LOG_ODELAY, LOG_AUTH);
 #endif
+    XtSetArg (arglist[0], XtNalternativeAuth, (char *) &(greet->allow_pam_first));
+    XtGetValues (login, arglist, 1);
+    Debug ("allow_pam_first from xresources xlogin*alternativeAuth = %d\n", greet->allow_pam_first);
     for (;;) {
 	/*
 	 * Greet user, requesting name/password
diff -ur xdm-1.0.5/greeter/verify.c xdm-1.0.5_bio-clean/greeter/verify.c
--- xdm-1.0.5/greeter/verify.c	2006-04-14 13:17:31.000000000 -0700
+++ xdm-1.0.5_bio-clean/greeter/verify.c	2006-09-15 17:22:07.000000000 -0700
@@ -415,7 +415,7 @@
 	p = getpwnam (greet->name);
 	endpwent();
 
-	if (!p || strlen (greet->name) == 0) {
+	if (!(greet->allow_pam_first) && (!p || strlen (greet->name) == 0)) {
 		Debug ("getpwnam() failed.\n");
 		bzero(greet->password, strlen(greet->password));
 		return 0;
@@ -606,6 +606,11 @@
 	PAM_BAIL;
 	pam_error = pam_setcred(*pamhp, 0);
 	PAM_BAIL;
+	/* if identification was performed, username is known now */
+	if (strlen (greet->name) == 0) {
+		pam_error = pam_get_user(*pamhp, &(greet->name), NULL);
+		PAM_BAIL;
+	}
 	p = getpwnam (greet->name);
 	endpwent();
 
diff -ur xdm-1.0.5/xdm.man.cpp xdm-1.0.5_bio-clean/xdm.man.cpp
--- xdm-1.0.5/xdm.man.cpp	2005-10-17 19:12:17.000000000 -0700
+++ xdm-1.0.5_bio-clean/xdm.man.cpp	2006-09-15 17:20:38.000000000 -0700
@@ -987,6 +987,11 @@
 if the account does not require a password at all.
 The default is ``false'', so only users that have passwords assigned can
 log in.
+.IP "\fBxlogin.alternativeAuth\fP"
+If set to ``true'', don't give prompt for the first time and directly call PAM.
+Give login box only after first PAM authorization fail. This is useful set to 
+``true'' if you have biometrics identification functional.
+The default is ``false''.
 .IP "\fBxlogin.Login.translations\fP"
 This specifies the translations used for the login widget.  Refer to the X
 Toolkit documentation for a complete discussion on translations.  The default
