diff --git a/install/conf/ipa.conf b/install/conf/ipa.conf index f256dab4d..676086a90 100644 --- a/install/conf/ipa.conf +++ b/install/conf/ipa.conf @@ -44,8 +44,23 @@ WSGIScriptReloading Off KrbConstrainedDelegationLock ipa -# Protect /ipa with Kerberos - +# Protect UI login url with Kerberos + + AuthType Kerberos + AuthName "Kerberos Login" + KrbMethodNegotiate on + KrbMethodK5Passwd off + KrbServiceName HTTP + KrbAuthRealms $REALM + Krb5KeyTab /etc/httpd/conf/ipa.keytab + KrbSaveCredentials on + KrbConstrainedDelegation on + Require valid-user + ErrorDocument 401 /ipa/errors/unauthorized.html + + +# Protect xmlrpc url with Kerberos + AuthType Kerberos AuthName "Kerberos Login" KrbMethodNegotiate on diff --git a/install/ui/ipa.js b/install/ui/ipa.js index f905b4178..a424fe95a 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -59,6 +59,7 @@ var IPA = function() { // if current path matches live server path, use live data if (that.url && window.location.pathname.substring(0, that.url.length) === that.url) { that.json_url = params.url || '/ipa/json'; + that.login_url = params.url || '/ipa/login'; // FIXME, what about the other case below? } else { // otherwise use fixtures that.json_path = params.url || "test/data"; @@ -285,6 +286,31 @@ var IPA = function() { return that; }(); +IPA.get_credentials = function() { + var status; + + function error_handler(xhr, text_status, error_thrown) { + status = xhr.status; + } + + + function success_handler(data, text_status, xhr) { + status = xhr.status; + } + + var request = { + url: IPA.login_url, + async: false, + type: "GET", + success: success_handler, + error: error_handler + }; + + $.ajax(request); + + return status; +} + /** * Call an IPA command over JSON-RPC. * @@ -378,6 +404,39 @@ IPA.command = function(spec) { dialog.open(); } + /* + * Special error handler used the first time this command is + * submitted. It checks to see if the session credentials need + * to be acquired and if so sends a request to a special url + * to establish the sesion credentials. If acquiring the + * session credentials is successful it simply resubmits the + * exact same command after setting the error handler back to + * the normal error handler. If aquiring the session + * credentials fails the normal error handler is invoked to + * process the error returned from the attempt to aquire the + * session credentials. + */ + function error_handler_login(xhr, text_status, error_thrown) { + if (xhr.status === 401) { + var login_status = IPA.get_credentials(); + + if (login_status === 200) { + that.request.error = error_handler + $.ajax(that.request); + } else { + // error_handler() calls IPA.hide_activity_icon() + error_handler.call(this, xhr, text_status, error_thrown); + } + } + } + + /* + * Normal error handler, handles all errors. + * error_handler_login() is initially used to trap the + * special case need to aquire session credentials, this is + * not a true error, rather it's an indication an extra step + * needs to be taken before normal processing can continue. + */ function error_handler(xhr, text_status, error_thrown) { IPA.hide_activity_icon(); @@ -472,20 +531,20 @@ IPA.command = function(spec) { } } - var data = { + that.data = { method: that.get_command(), params: [that.args, that.options] }; - var request = { - url: IPA.json_url || IPA.json_path + '/' + (that.name || data.method) + '.json', - data: JSON.stringify(data), + that.request = { + url: IPA.json_url || IPA.json_path + '/' + (that.name || that.data.method) + '.json', + data: JSON.stringify(that.data), success: success_handler, - error: error_handler + error: error_handler_login }; IPA.display_activity_icon(); - $.ajax(request); + $.ajax(that.request); }; that.get_failed = function(command, result, text_status, xhr) { diff --git a/ipa-client/man/default.conf.5 b/ipa-client/man/default.conf.5 index 938eb2c91..91b535ab8 100644 --- a/ipa-client/man/default.conf.5 +++ b/ipa-client/man/default.conf.5 @@ -49,11 +49,11 @@ Values should not be quoted, the quotes will not be stripped. .np # Wrong \- don't include quotes - verbose = "9" + verbose = "True" # Right \- Properly formatted options - verbose = 9 - verbose=9 + verbose = True + verbose=True .fi Options must appear in the section named [global]. There are no other sections defined or used currently. @@ -80,8 +80,43 @@ Specifies the hostname of the dogtag CA server. The default is the hostname of t .B context Specifies the context that IPA is being executed in. IPA may operate differently depending on the context. The current defined contexts are cli and server. Additionally this value is used to load /etc/ipa/\fBcontext\fR.conf to provide context\-specific configuration. For example, if you want to always perform client requests in verbose mode but do not want to have verbose enabled on the server, add the verbose option to \fI/etc/ipa/cli.conf\fR. .TP +.B verbose +When True provides more information. Specifically this sets the global log level to "info". +.TP .B debug -If True then logging will be much more verbose. Default is False. +When True provides detailed information. Specifically this set the global log level to "debug". Default is False. +.TP +.B log_logger_XXX +loggers matching regexp will be assigned XXX level. +.IP +Logger levels can be explicitly specified for specific loggers as +opposed to a global logging level. Specific loggers are indiciated +by a list of regular expressions bound to a level. If a logger's +name matches the regexp then it is assigned that level. This config item +must begin with "log_logger_level_" and then be +followed by a symbolic or numeric log level, for example: +.IP + log_logger_level_debug = ipalib\\.dn\\..* +.IP + log_logger_level_35 = ipalib\\.plugins\\.dogtag +.IP +The first line says any logger belonging to the ipalib.dn module +will have it's level configured to debug. +.IP +The second line say the ipa.plugins.dogtag logger will be +configured to level 35. +.IP +This config item is useful when you only want to see the log output from +one or more selected loggers. Turning on the global debug flag will produce +an enormous amount of output. This allows you to leave the global debug flag +off and selectively enable output from a specific logger. Typically loggers +are bound to classes and plugins. +.IP +Note: logger names are a dot ('.') separated list forming a path +in the logger tree. The dot character is also a regular +expression metacharacter (matches any character) therefore you +will usually need to escape the dot in the logger names by +preceeding it with a backslash. .TP .B domain The domain of the IPA server e.g. example.com. @@ -128,12 +163,12 @@ If the IPA server fails to start and this value is True the server will attempt .B validate_api Used internally in the IPA source package to verify that the API has not changed. This is used to prevent regressions. If it is true then some errors are ignored so enough of the IPA framework can be loaded to verify all of the API, even if optional components are not installed. The default is False. .TP -.B verbose -Generates more output. The default is 0 which generates no additional output. On the client a setting of 1 will provide more information on the command and show the servers the client contacts. A setting of 2 or higher will display the XML\-RPC request. This value has no effect on the server. -.TP .B xmlrpc_uri Specifies the URI of the XML\-RPC server for a client. This is used by IPA and some external tools as well, such as ipa\-getcert. e.g. https://ipa.example.com/ipa/xml .TP +.B session_auth_duration