I would check if your units can do RADIUS or TACACS, for which there are mature open source implementations.