Giter VIP home page Giter VIP logo

kerberos-demo's Introduction

kerberos-demo

Spring Boot demonstration of Spring Security Kerberos for SSO

This example will show you how to:

  • Build SSO using Kerberos in an Windows environment
  • This application is tested running on a Windows 7 desktop
  • AD is Windows Server 2008 R2
  • Clients are MSIE11 and Chrome both running on Window 7 desktop
  • Java version is 1.8.131
  • Spring Security with full JAVA Annotations, no XML conf involved
  • Running with embedded Tomcat in version 8.5.15

Read the source code to learn about the various configurations required to make the application run.

Generate a correct working keytab file

There is 2 small utillity classes available, that can help verify a working setup.

  • JceTest - verifies full crypto support, started with java -cp target\kerberos-demo.jar -Dloader.main=com.findwise.kerberos.JceTest org.springframework.boot.loader.PropertiesLauncher

  • KrbTest - verifies if your keytab file is usable, started with java -cp target\kerberos-demo.jar -Dloader.main=com.findwise.kerberos.KrbTest org.springframework.boot.loader.PropertiesLauncher krb_test.properties

It cannot be stated enough, that most Kerberos related errors relates to the fact, that the keytab file is not generated correctly.

Follow the guide here:

Test the keytab using the KrbTest class after customization to your setup. When the KrbTest can successfully perform the following steps you are good to go:

  • Pre-Authenticate as the principal stored in the keytab (require JCE)
  • Extract the Kerberos Service Ticket

Verify your progress using the provided full debug log

As there is so many steps required for a successfull login to happen I have provided a debug log.

  • See: DebugLog.md

Java Cryptography Extention (JCE)

To get up and running, the JRE/JDK running this application must be enhanced with the US export restricted crypto package.

Grap your copy here:

Spring Boot bug

In version 1.4.3.RELEASE of the Spring Boot Maven plugin there is introduced a packaging bug. To run this application as a fat jar the version of the Spring Boot Maven plugin must be <= 1.4.2.RELEASE

If you encounter this bug, the Spring Security setup can't find the login page, thus nothing works....

Credit to Karthikeyan Vaithilingam

Karthikeyan Vaithilingam wrote an excellent blog about how to configure kerberos for localhost access - The code in this project is almost identical, with minor changes to adapt to Spring Security Java configuration instead of the old XML based configuration.

Usefull ressources

kerberos-demo's People

Contributors

petergylling avatar gyllingsw avatar

Watchers

Martin Goldhahn avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.