I have my own authentication mechanism written in Java. I was wondering what would be the best way to implement the Linux PAM module without rewriting the code in C?
I know this list of available PAM modules , but none of them are Java related.
There is also JPam , but it does the opposite: it allows you to get information about the user / group that will be used in the Java application, while I need to use the existing Java code to authenticate users in Linux (for example, via SSH).
Any suggestions are welcome.
:
.
, pam_exec?
script PAM.
. PAM - :
auth sufficient pam_exec.so expose_authtok /usr/local/bin/myscript-example
script, vars, Java, .
, script , auth .
script, :
#!/bin/sh read password echo "User: $PAM_USER" echo "Ruser: $PAM_RUSER" echo "Rhost: $PAM_RHOST" echo "Service: $PAM_SERVICE" echo "TTY: $PAM_TTY" echo "Password : $password" exit $?
C PAM , JNI JVM.
JVM , "exe", JAR. , JNI, JVM ; , JNI C Java.
, JVM C-, . C PAM , .
, , JNI Java . , "C" (, char *) Java JVM. Java PAM.
!
Java C-, PAM. JNI (Java Native Interface). JNI C Java, . GNU CNI, . , Wikipedia JNI
http://jaas-pam.sourceforge.net/
It performs user authentication and works with the Tomcat jaas realm, but does not return any group / role information, so there is no role-based web authentication.
Source: https://habr.com/ru/post/1752353/More articles:"ведущая" ветвь пропускает ревизии после последовательных вызовов git svn fetch " - gitHow to make Authlogic sessions for all subdomains - subdomainEntity Framework 4 - can I call the SSDL function from another command text of the SSDL function? - entity-frameworkWhat does the filtered EXPLAIN query column mean in MySQL? - mysqlЕсть ли лучший/более чистый способ условного создания типа, чем использование instanceof? [Ява] - javaRails 2 - partial: what does @comment = Comment.new mean? - ruby | fooobar.comHow should QA staff accurately evaluate? - qaIn Mercurial, why can't we undo commit when there are other modified files? - dvcsIs there a good way to edit text values in SQL Server Management Studio? - sql-serverPython question about time spent - pythonAll Articles