LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2007, 11:20 PM   #1
shoaibi
LQ Newbie
 
Registered: May 2005
Location: Pakistan, South Asia
Distribution: Ubuntu, Simply MEPIS, SUSE, Mandrake, Red Hat, Kubuntu, Fedora
Posts: 16

Rep: Reputation: 0
Remote Authentication


I am developing a java application on RHEL5, which takes username and password from the user, and then authenticates it from the linux operating system.
How is that possible? i mean the authentication part?
is there a service/daemon in linux that can perform user authentication on behalf of a request from a java application?
 
Old 09-28-2007, 04:25 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by shoaibi View Post
I am developing a java application on RHEL5, which takes username and password from the user, and then authenticates it from the linux operating system.
How is that possible? i mean the authentication part?
is there a service/daemon in linux that can perform user authentication on behalf of a request from a java application?
Yes, the service is called PAM. The Java interface with PAM is called Jpam.

http://jpam.sourceforge.net/

------------------
Steve Stites
 
Old 10-06-2007, 06:45 AM   #3
shoaibi
LQ Newbie
 
Registered: May 2005
Location: Pakistan, South Asia
Distribution: Ubuntu, Simply MEPIS, SUSE, Mandrake, Red Hat, Kubuntu, Fedora
Posts: 16

Original Poster
Rep: Reputation: 0
Okay, here is the problem.
I have downloaded JPAM 1.1 for Linux and installedas it was told in the INSTALL File and the Online Documentation.
But i had this problem that the $java_home/bin/x where x=client OR server didn't exist. So i created both folders and pasted the libjpam.so file there.

After that i ran my code(provided below), and it gave exceptions. I read the manual again, and it says, if the JPAM can't find files, it will seach in local fodler as well, so i made a copy in local folder as well. and ran the same code again but the same ClassNotFound Exception appeared.

I posted on JPAM Forums, but no one replied, so i am posting it here so that if anyone knows JPAM, i would request his help.


Here is the list of pan modules that i have installed:
Code:
pam_krb5-2.2.11-1
pam_smb-1.1.7-7.2.1
pam_pkcs11-0.5.3-23
pam-0.99.6.2-3.14.el5
pam_ccreds-3-5
pam_passwdqc-1.0.2-1.2.2
pam-devel-0.99.6.2-3.14.el5
Here is the code:
Code:
/*
 * Main.java
 *
 * Created on October 2, 2007, 12:09 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package autenticate;
import net.sf.jpam.*;
/**
 *
 * @author shoaibi
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String user1Name = "test";
        String user1Credentials = "password";
        Pam mypam = new Pam(); //When i click the link in error, i get here.
        boolean authenticated = mypam.authenticateSuccessful(user1Name, user1Credentials);
        if(authenticated ==true)
        {
            System.out.println("Congrats\nYou have logged In");
            
        }
        else
            System.out.println("Sorry\nAuthentication Failed");
    }
    
}

Here is the Error:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
        at net.sf.jpam.Pam.<clinit>(Pam.java:38)
        at autenticate.Main.main(Main.java:28) //this points to the Pam object creation line
Java Result: 1

What could possibly go wrong?

I have JDK6u2 installed. and i set all classpaths and etc....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to secure VNC remote access with two-factor authentication LXer Syndicated Linux News 0 05-23-2007 02:46 PM
Remote Authentication failing in multiple apps upsco2002 Linux - Security 2 05-30-2005 06:47 PM
ssh public key authentication to different remote home directory shawn_t Linux - Networking 2 03-20-2005 03:39 PM
Remote authentication sinistamunkey Linux - Networking 2 02-10-2005 06:56 PM
samba and remote PAM authentication chupacabra Linux - General 2 11-08-2002 12:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration