Script plugin for OpenVPN, using Kingsoft SSO as authentication backend.
Built and tested on Ubuntu Server 18.04 LTS.
-
Install GraalVM and native-image (>= 19.3.1, Java 11)
-
Run
build.sh
export GRAALVM_HOME=<GraalVM Install Dir> export JAVA_HOME=$GRAALVM_HOME ./build.sh
After build step, you need to deploy files in the build
directory to the server running OpenVPN:
-
Configure environment variables in
build/auth-kingsoft-sso.conf
-
Copy all files to
/opt/openvpn/
with ownerroot
, with permissions:$ ll -h /opt/openvpn/ total 22M drwxr-xr-x 2 root root 4.0K Oct 29 19:30 ./ drwxr-xr-x 4 root root 4.0K Oct 29 17:44 ../ -rw-r--r-- 1 root root 153 Oct 29 18:22 auth-kingsoft-sso.conf -rwxr-xr-x 1 root root 386 Oct 29 19:30 auth-kingsoft-sso.sh* -rwxr-xr-x 1 root root 22M Oct 29 17:56 openvpn-auth-kingsoft-sso*
-
Add the following to OpenVPN server-side configuration file:
auth-user-pass-verify /opt/openvpn/auth-kingsoft-sso.sh via-file
-
Restart the OpenVPN service.