in proxyuser case, do use username rather than principal

This commit is contained in:
Yuming Zhu 2019-04-19 00:19:12 +08:00 committed by Yu Ming Zhu
parent d662fb837d
commit 2408e86ff6

View file

@ -429,13 +429,13 @@ class Session(object):
else:
raise koji.AuthError('%s is not authorized to login other users' % client_dn)
if authtype == koji.AUTHTYPE_GSSAPI:
if authtype == koji.AUTHTYPE_GSSAPI and '@' in username:
user_id = self.getUserIdFromKerberos(username)
else:
user_id = self.getUserId(username)
if not user_id:
if context.opts.get('LoginCreatesUser'):
if authtype == koji.AUTHTYPE_GSSAPI:
if authtype == koji.AUTHTYPE_GSSAPI and '@' in username:
user_id = self.createUserFromKerberos(username)
else:
user_id = self.createUser(username)