| |
@@ -1,5 +1,6 @@
|
| |
# Copyright (C) 2013 Ipsilon project Contributors, for license see COPYING
|
| |
|
| |
+ from pwd import getpwnam
|
| |
from ipsilon.login.common import LoginFormBase, LoginManagerBase, \
|
| |
LoginManagerInstaller
|
| |
from ipsilon.util.plugin import PluginObject
|
| |
@@ -22,6 +23,10 @@
|
| |
username, password, service=self.lm.service_name
|
| |
)
|
| |
if result:
|
| |
+ # The actual username may be different from the requested
|
| |
+ # username. For example SSSd allows logging in with the email
|
| |
+ # address, but we want the actual username here.
|
| |
+ username = getpwnam(username).pw_name
|
| |
self.log("User %s successfully authenticated." % username)
|
| |
return self.lm.auth_successful(
|
| |
self.trans, username, 'password'
|
| |
Add a call to
getpwnam()
in the PAM auth module, because the actualusername may be different from the requested username. For example SSSd
allows logging in with the email address, but we want the actual
username to be used throughout the application.
Fixes: #358