I've circled back on this and am trying to do this with a post_auth script but I'm having trouble parsing the users client version
Here is the script that I'm using
from pyovpn.plugin import *
from packaging.version import parse # Import version parsing utility
def post_auth(authcred, attributes, authret, info):
# get user's property list, or create it if absent
proplist = authret.setdefault('proplist', {})
# get ASCLI version, default to 0.0.0 if missing
uv_ascli_ver = proplist.get('UV_ASCLI_VER', '0.0.0')
# Compare UV_ASCLI_VER with 3.7.0
if parse(uv_ascli_ver) > parse(3.7.0):
authret['status'] = SUCCEED
else:
authret['status'] = FAIL # Fail authentication
authret['reason'] = 'ASCLI version too low'
authret['client_reason'] = 'Client version is too old. Need to have greater than 3.7.0. You have ${uv_ascli_ver}'
return authret