烧瓶Tacacs +认证 [英] Flask Tacacs+ authentication
问题描述
我搜索了python tacacs模块,只找到了服务器,那里肯定不会是tacacs的烧瓶模块。通常我会perl的,但我不认为写perl包装获得认证是一个很好的解决方案。
我可以写一些东西来通过auth通过SSH我猜,如果auth在设备上工作,那么用户是好,但这似乎是一个非常可怕的方式来做到这一点。
有谁知道如何让Python来验证对TACACS +框?当我查看了TACACS如何在互联网上工作时,结果显得非常少。 解决方案
您是否尝试过使用 https://github.com/ansible/tacacs_plus 。
#!/ usr / bin / env python
import tacacs_plus
auth = tacacs_plus.TACACSClient('host',49,'secret',timeout = 10).authenticate(
'username','password',tacacs_plus.TAC_PLUS_AUTHEN_TYPE_ASCII
)
print通过!如果auth.valid否则失败!
I've written a flask app which has been working fine with its own authentication on a MySQL Database but I'm now being asked to authenticate against a TACACS+ box instead of the internal authentication.
I've searched for python tacacs modules and have only found servers, there certainly doesn't appear to be a flask module for tacacs. Typically i fould perl ones but I don't feel that writing a wrapper around perl to get the authentication is a neat solution.
I could write something to pass through the auth via SSH I guess, and if the auth works on a device then the user is "OK" but that seems like a really horrible way to do it.
Does anyone know how to get python to authenticate against a TACACS+ box? When I've looked for how TACACS works on the internet the results seem very scant.
have you tried using https://github.com/ansible/tacacs_plus . from the site.
#!/usr/bin/env python
import tacacs_plus
auth = tacacs_plus.TACACSClient('host', 49, 'secret',timeout=10).authenticate(
'username', 'password', tacacs_plus.TAC_PLUS_AUTHEN_TYPE_ASCII
)
print "PASS!" if auth.valid else "FAIL!"
这篇关于烧瓶Tacacs +认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!