Skip to content

Instantly share code, notes, and snippets.

@MariusSchiffer
Created May 12, 2012 20:09
Show Gist options
  • Save MariusSchiffer/2668679 to your computer and use it in GitHub Desktop.
Save MariusSchiffer/2668679 to your computer and use it in GitHub Desktop.
freeradius oath
# -*- text -*-
#
# $Id$
# Compares the a token generated with a token seed with the User-Password (TOTP)
exec oath {
# wait for the program
wait = yes
# Compares the token with User-Password
program = "/usr/bin/oath_radius --time-step-size=60 --totp %{control:OTP-Token}"
input_pairs = request
output_pairs = control
shell_escape = yes
}
# ...
update control {
Cleartext-Password := "%{oath:/usr/bin/oath_radius --time-step-size=60s --totp <TOKEN>}"
}
# ...
# ...
# look for instantiate
instantiate {
exec
oath
# ...
#!/bin/sh
env oathtool "$@" 2>/dev/null | tr -d '\n'
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment