Added new authentication method

Addressing ticket https://fedorahosted.org/freeipa/ticket/5764

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Tiboris 2016-08-16 14:13:29 +02:00 committed by Jan Cholasta
parent c36d721a01
commit d25a0725c0
2 changed files with 18 additions and 5 deletions

View File

@ -28,12 +28,16 @@ register = Registry()
if api.env.context in ('server', 'lite'):
from ipaserver.rpcserver import wsgi_dispatch, xmlserver, jsonserver_kerb, jsonserver_session, login_kerberos, login_password, change_password, sync_token, xmlserver_session
from ipaserver.rpcserver import (
wsgi_dispatch, xmlserver, jsonserver_kerb, jsonserver_session,
login_kerberos, login_x509, login_password, change_password,
sync_token, xmlserver_session)
register()(wsgi_dispatch)
register()(xmlserver)
register()(jsonserver_kerb)
register()(jsonserver_session)
register()(login_kerberos)
register()(login_x509)
register()(login_password)
register()(change_password)
register()(sync_token)

View File

@ -857,16 +857,16 @@ class jsonserver_kerb(jsonserver, KerberosWSGIExecutioner):
key = '/json'
class login_kerberos(Backend, KerberosSession, HTTP_Status):
key = '/session/login_kerberos'
class KerberosLogin(Backend, KerberosSession, HTTP_Status):
key = None
def _on_finalize(self):
super(login_kerberos, self)._on_finalize()
super(KerberosLogin, self)._on_finalize()
self.api.Backend.wsgi_dispatch.mount(self, self.key)
self.kerb_session_on_finalize()
def __call__(self, environ, start_response):
self.debug('WSGI login_kerberos.__call__:')
self.debug('WSGI KerberosLogin.__call__:')
# Get the ccache created by mod_auth_gssapi
user_ccache_name=environ.get('KRB5CCNAME')
@ -876,6 +876,15 @@ class login_kerberos(Backend, KerberosSession, HTTP_Status):
return self.finalize_kerberos_acquisition('login_kerberos', user_ccache_name, environ, start_response)
class login_kerberos(KerberosLogin):
key = '/session/login_kerberos'
class login_x509(KerberosLogin):
key = '/session/login_x509'
class login_password(Backend, KerberosSession, HTTP_Status):
content_type = 'text/plain'