def __init__(self, cas_group, cas_username, cas_password, cas_host=None, secure=True, loglevel=logging.INFO):
""" Constructor
Args:
cas_group (str): The group to authenticate with CAS
cas_username (str): The username to authenticate with CAS
cas_password (str): The password to authenticate with CAS
cas_host (str): The host/IP of the CAS server
secure (bool): Enable the certificate check or not
loglevel (int): Log level
"""
assert cas_group and len(cas_group) > 0
self._cas_group = cas_group
assert cas_username and len(cas_username) > 0
self._cas_username = cas_username
assert cas_password and len(cas_password) > 0
self._cas_password = cas_password
self._cas_host = self.__sso_cas_host if not cas_host else cas_host
self._tgt = None
self._logger = get_logger(loglevel)
# Init urllib2
self._init_urllib(secure)
self._logger.debug("CAS object (%s,%s,%s,%s) constructed" % (cas_host, cas_group, cas_username, cas_password))
评论列表
文章目录