Signed-off-by: Simo Sorce <simo@redhat.com>
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ipsilon.login.common import LoginPageBase, LoginManagerBase
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ipsilon.login.common import LoginPageBase, LoginManagerBase
+from ipsilon.util.user import UserSession
def root(self, *args, **kwargs):
# If we can get here, we must be authenticated and remote_user
def root(self, *args, **kwargs):
# If we can get here, we must be authenticated and remote_user
- # was set. Check the session has a use set already or error.
+ # was set. Check the session has a user set already or error.
if self.user and self.user.name:
if self.user and self.user.name:
- return self.lm.auth_successful(self.user.name)
+ userdata = { 'krb_principal_name': self.user.name }
+ return self.lm.auth_successful(self.user.name, userdata)
else:
return self.lm.auth_failed()
else:
return self.lm.auth_failed()
authtime_notbefore = authtime - skew
authtime_notafter = authtime + skew
authtime_notbefore = authtime - skew
authtime_notafter = authtime + skew
- user = UserSession().get_user()
+ us = UserSession()
+ user = us.get_user()
# TODO: get authentication type fnd name format from session
# need to save which login manager authenticated and map it to a
# TODO: get authentication type fnd name format from session
# need to save which login manager authenticated and map it to a
nameid = user.name ## TODO map to something else ?
elif self.nameidfmt == lasso.SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT:
nameid = user.name ## TODO map to something else ?
nameid = user.name ## TODO map to something else ?
elif self.nameidfmt == lasso.SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT:
nameid = user.name ## TODO map to something else ?
+ elif self.nameidfmt == lasso.SAML2_NAME_IDENTIFIER_FORMAT_KERBEROS:
+ nameid = us.get_data('user', 'krb_principal_name')
if nameid:
login.assertion.subject.nameId.format = self.nameidfmt
if nameid:
login.assertion.subject.nameId.format = self.nameidfmt