Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help?: Authentification - NIS+ & Oracle Web
Yes, we did just that for a web based timesheet application - here is a
code that can be worked
around to do what you need to do: "validate.c"
#include <stdio.h>
#include <pwd.h>
#include <shadow.h>
#include <sys/types.h>
int
main(int argc, char *argv[])
{
struct spwd *pwd2;
// char *encrypted_passwd;
char user[40], clearPassword[512];
if(argc != 3)
{ fprintf(stderr,"Usage: validate username clearpassword\n"); exit(1); }
pwd2=getspnam(argv[1]); //argv[1]);
// encrypted_passwd = crypt(argv[2], "r0");
if(pwd2 != NULL) {
printf("Shadow Name.........: [%s]\n",pwd2->sp_namp); printf("Shadow Password.....: [%s]\n",pwd2->sp_pwdp); if (strcmp (crypt (argv[2], pwd2->sp_pwdp), pwd2->sp_pwdp) == 0) { printf("\nAuthenticated!\n"); } else { printf("\n\nInvalid Password!\n\n"); } } else { fprintf(stderr,"User \"%s\" not found!\n",argv[1]); }
exit(0);
}
Dan Kirkpatrick wrote:
> I'm looking for a way to be able to authenticate users in our oracle > web applications, by checking against our Solaris Unix NIS+ maps. > > Is there a way to have a function, lets say a 'C' program that will > send NIS+ a username and password, and NIS+ will return whether it was > valid or not? > If not... is there any other way? > > Has anyone done anything like this? > How can we go about it? > > I TOTALLY appreciate your help! > > Dan Kirkpatrick > kirkpatrickd_at_rl.af.mil > Rome Laboratory, Griffiss Technology ParkReceived on Fri Feb 09 2001 - 17:43:18 CST