tacacs_plus | based TACACS client that supports authentication | Authorization library
kandi X-RAY | tacacs_plus Summary
kandi X-RAY | tacacs_plus Summary
A Python-based TACACS+ client that supports authentication, authorization and accounting.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tacacs_plus
tacacs_plus Key Features
tacacs_plus Examples and Code Snippets
$ pip install tacacs_plus
$ tacacs_client -u myuser -H localhost authenticate
$ tacacs_client -u myuser -H localhost authenticate -t pap
$ tacacs_client -u myuser -H localhost -v authenticate -t chap
status: PASS
$ tacacs_client -u myuser -H localh
#!/usr/bin/env python
from __future__ import print_function
from tacacs_plus.client import TACACSClient
from tacacs_plus.flags import TAC_PLUS_ACCT_FLAG_START, TAC_PLUS_ACCT_FLAG_WATCHDOG, TAC_PLUS_ACCT_FLAG_STOP
import socket
# For IPv6, use `fami
Community Discussions
Trending Discussions on tacacs_plus
QUESTION
I'm trying to implement a TACACS+ based flask_login system and I'm stuck because the current_user.is_authenticated
is always false. I am not using any local databases - the username and password that is submitted via my login form are directly passed to TACACS.
My custom User
class implements the 3 attributes and 1 method described in flask_login's documentation here:
Below, you'll find the relevant code for each file so you can set this up in your own environment.
There is a lot of information below, so I wanted to share my actual question as clearly as possible:
How can I connect my customUser
class to the current_user
proxy?
The underlying issue with my implementation is that when I go to any flask routes with the @login_required
decorator, the app thinks the user is not logged in and redirects them to the login page. I've determined it to be because the current_user.is_authenticated
attribute is never True.
app.py
...ANSWER
Answered 2020-Mar-10 at 20:35I figured it out after dissecting my code for the quadrillionth time.
Simply put, I was missing the login_user() function call. This is what associates the custom User class to the flask_login current_user
association.
I also needed to create a simple local username storage method so that the required load_user
function could work properly. I did this by adding a globally accessible dictionary that stores my custom User object as a value associated to a key that holds the username.
I will update the code snippets in my original post with these changes in hopes that my efforts will be useful for someone in the future. I couldn't find much online about integrating TACACS with flask_login.
QUESTION
I used TACACS+ using image form here that work well with both following methods, until I see the accounting logs:
By
docker run
, it can logs the actual switches address for the NAS field.By Rancher Deployment, it logs the Rancher Nodes address instead the switches address for the NAS field, like this with yellow marked.
Is it expected behaviour for Rancher/K8s? Or it need some tweak on my deployment? Here is my Port mapping setup.
Honestly, I'd prefer to use method no. 2 due to its beneficial (scaling, self-healing, and so on).
...ANSWER
Answered 2019-Dec-29 at 01:05I think I found the culprit by manage hostNetwork
from false to true, it works now.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tacacs_plus
You can use tacacs_plus like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page