The Kerberos Idp Handler uses the kerberos protocol to implement an SSO (Single Sing On) authentication mechanism.
A presentation with some general information about the project can be found on the SWITCH website
To use the "Kerberos Login Handler" in the Identity Provider, first is necessary to have the kerberos environment configured and working properly.
Some interesting tutorials are:
Before start please check if:
- The service-principal (usually "HTTP/principal@your_realm.com") was configured at the KDC
- The keytab file that holds the key of the service-principal was generated (recommended)
- In the IDP: Check if is possible to get the service tickets with kinit from the KDC.
There is also a step by step guide to setting up kerberos at http://research.ncl.ac.uk/gfivo/documents/UsingKerberosticketsfortrueSingleSignOn.pdf The hardest area in getting shibboleth setup with kerberos "true single sign on" is the kerberos setup. It is therefore recommended that you get kerberos to work on it's own on the IdP server before you try integrating with shibboleth. This guide walks you through these steps, once you have kerberos setup and working on it's own integration with shibboleth is relatively straight forward. The guide details setup of mod_auth_kerb which is the simplest route to proving you have SPNEGO based "true single sign on" working . Once that is setup the Kerberos login handler detailed in this wiki page is a better solution for providing a user facing service as it's behavior when dealing with clients that don't have a kerberos ticket (mobile phones etc) is superior in that it presents a "web form" based login rather than the grey pop up "basic auth" login box.
Installation and configuration
- Download and build the source (replace X.0 with the last stable version, e.g.: "tags/1.0"):
IdP - Configuration
Copy the example pages from the source (/examples) to the installation folder at: $IDP_INSTALL_DIR/src/main/webapp/
- Basic installation:
- kerberos-default.jsp.dist (rename to kerberos-default.jsp) - Main configuration file
- kerberos-login.inc.jsp - The source code for the kerberos login form.
- kerberos.css.dist - (rename to kerberos.css) Some styles to the kerberos login page.
- kerberos-report.jsp (necessary if showTestPage=true at kerberos-default.jsp) - Test page to verify if the browser supports kerberos and links to documentation.
- kerberos-config.jsp (necessary if option2Hide=true at kerberos-default.jsp) - Change the kerberos options (enabled, visible and auto-login) at the client/browser.
- login_example.jsp - Example of Kerberos integrated with "UsernamePassword" Idp login page.
- kerberos-login.jsp - Example of "Kerberos-only" login page.
- unauthorized.html - Custom message for "401 - unauthorized" error (necessary if customUnauthorized configured at handler.xml).
Rename the distribution files:
And check the configurations at kerberos-default.jsp. In this file you can change the text messages, enable or disable some functionality (kerberos enabled, visible and auto-login) and customize functions.
Copy the .jar file to the installation folder:
To expose the Kerberos Login Handler to the user you have two options. Either you include a snippet into your existing UsernamePassword Login Handler or you can use just the Kerberos Login Handler.
1 - Kerberos embedded with UsernamePassword login page
- Rename "login_example.jsp" to "login.jsp" if there is not yet a "login page" installed.
- Edit the "login.jsp" (UsernamePassword login page) and include the following code snipped where you want that kerberos (button) shows up.
2 - "Kerberos only" login page
- Verify if "kerberos-login.inc.jsp" is in the "$IDP_INSTALL_DIR/src/main/webapp/" folder
- Use the "kerberos-login.jsp" page as an example. Rename it to login.jsp
Configuring the server (tomcat)
In the web-application you have to enable the Kerberos login servlets. You do that in $IDP_INSTALL_DIR/src/main/webapp/WEB-INF/web.xml:
- If you change the standard "KrbLoginServlet" url-pattern ("/Authn/Kerberos/Login"), you need also to set "krbServletPattern" in the kerberos-login-handler.xsd file.
- If you change the standard "UsernamePasswordAuthHandler" url-pattern ("/Authn/UserPassword"), you need also to set "loginPagePattern" in the kerberos-login-handler.xsd file.
- Pay attention that you still need the "UsernamePassword" Idp active and configured, in order to use both authentication methods.
Kerberos - Test Page
There is a Servlet to test if the browser supports kerberos. This configuration is necessary if showTestPage=true at kerberos-default.jsp (default=false).
- The "kerberos-report.jsp" file must to be in the "$IDP_INSTALL_DIR/src/main/webapp/" folder
- Configure the servlet at $IDP_INSTALL_DIR/src/main/webapp/WEB-INF/web.xml:
Configure the handler.xml at:
- new install: $IDP_INSTALL_DIR/src/installer/resources/conf-tmpl/handler.xml
- reinstall: $IDP_DIR/conf/handler.xml
Attribute resolver configuration
Configure the attribute-resolver.xml at:
- new install: $IDP_INSTALL_DIR/src/installer/resources/conf-tmpl/attribute-resolver.xm
- reinstall: $IDP_DIR/conf/attribute-resolver.xml
Check if your configuration will accept the "principal name" provided by Kerberos (format: Principal@REALM.COM).
Here you can find an example.
The logging for the Handler is configured in the logging.xml file. It can be found at:
- new install: $IDP_INSTALL_DIR/src/installer/resources/conf-tmpl/logging.xml
- reinstall: $IDP_DIR/conf/logging.xml
Backup the IdP configuration before re-deploying the application:
Configuration - Client Side
The client's browser must to be configured before using Kerberos - Single Sign on. See the Documentation
- Project page (bugs, features): https://forge.switch.ch/redmine/projects/java-idp-kerberos-login-handler
- Some FAQ
Contact for comments/questions:
Rodrigo Ristow - firstname.lastname@example.org
University of Applied Sciences and Arts Northwestern Switzerland (FHNW)