Member since
02-19-2019
27
Posts
0
Kudos Received
0
Solutions
07-06-2020
09:14 AM
i , did you find a solution for that , i have the same request by audit team.
... View more
07-22-2019
02:54 PM
@mmmunafo, I guess your workaround should be OK. The only other two option I could see would be to wrap the pam.authenticate() call with an unset and set of KRB5CCNAME. Assuming authentication takes milliseconds, it would be unlikely that Hue is attempting to retrieve cache information at that moment, but I don't know that it is any better than what you are up to. for instance, in desktop/core/src/desktop/auth/backend.py wrap: if pam.authenticate(username, password, desktop.conf.AUTH.PAM_SERVICE.get()): With del os.environ['KRB5CCNAME'] and then after auth: os.environ['KRB5CCNAME'] = desktop.conf.KERBEROS.CCACHE_PATH.get() NOTE: we would need to import os in backend.py to do that. So possibly, something like this would work: class PamBackend(DesktopBackendBase):
"""
Authentication backend that uses PAM to authenticate logins. The first user to
login will become the superuser.
"""
@metrics.pam_authentication_time
def authenticate(self, request=None, username=None, password=None):
username = force_username_case(username)
del os.environ['KRB5CCNAME']
if pam.authenticate(username, password, desktop.conf.AUTH.PAM_SERVICE.get()):
os.environ['KRB5CCNAME'] = desktop.conf.KERBEROS.CCACHE_PATH.get()
is_super = False
if User.objects.count() == 0:
is_super = True
try:
if desktop.conf.AUTH.IGNORE_USERNAME_CASE.get():
user = User.objects.get(username__iexact=username)
else:
user = User.objects.get(username=username)
except User.DoesNotExist:
user = find_or_create_user(username, None)
if user is not None and user.is_active:
profile = get_profile(user)
profile.creation_method = UserProfile.CreationMethod.EXTERNAL.name
profile.save()
user.is_superuser = is_super
ensure_has_a_group(user)
user.save()
user = rewrite_user(user)
return user
os.environ['KRB5CCNAME'] = desktop.conf.KERBEROS.CCACHE_PATH.get()
return None
@classmethod
def manages_passwords_externally(cls):
return True Might not be worth it, though
... View more
07-11-2019
02:15 PM
@BiggieSmalls, The error you show indicates that the certificate and key files specified for Hue are not in the expected PEM format. The key needs to have the key stored in base64 between: -----BEGIN ENCRYPTED PRIVATE KEY----- -----END ENCRYPTED PRIVATE KEY----- The certificate file needs to have the certificate in base64 between: -----BEGIN CERTIFICATE----- -----END CERTIFICATE----- The "no start line" error from openssl libraries is explaining that it cannot find any BEGIN line make sure your ssl_certificate and ssl_private_key files contain the above text.
... View more
05-22-2019
01:13 PM
Not able to tag you in another thread. let me know if anything else need to be tried.
... View more