SlideShare a Scribd company logo
JBoss Negotiation in AS7
Get Kerberos authentication working
Josef Cacek
Senior QE Engineer, Red Hat
DevConf 2013
Agenda
 Technologies introduction
 Quickstart
 Configuration
 Troubleshooting
JBoss Negotiation in AS7
Introduction: Kerberos
 ticket based network authentication protocol
JBoss Negotiation
 Negotiation (SPNEGO) support for JBoss AS
● protocols
● Kerberos
● NTLM
● components
● authenticator – a JBoss Web valve
● JAAS Login modules
● toolkit to check the configuration
Quickstart
https://github.com/kwart/spnego-demo
https://github.com/kwart/kerberos-using-apacheds
JBoss AS configuration
$JBOSS_HOME/standalone/configuration/standalone.xml
standalone.xml – security domains (1)
<security-domain name="host" cache-type="default">
<authentication>
    <login-module code="Kerberos" flag="required">
      <module-option name="debug" value="true"/>
      <module-option name="storeKey" value="true"/>
      <module-option name="refreshKrb5Config" value="true"/>
      <module-option name="useKeyTab" value="true"/>
      <module-option name="doNotPrompt" value="true"/>
      <module option ‑ name="keyTab"
        value="/path/to/http.keytab"/>
      <module-option name="principal"
        value="HTTP/localhost@JBOSS.ORG"/>
    </login-module>
  </authentication>
</security-domain>
standalone.xml – security domains (2)
<security-domain name="SPNEGO" cache-type="default">
<authentication>
    <login-module code="SPNEGO" flag="required">
      <module-option name="serverSecurityDomain"
        value="host"/>
    </login-module>
  </authentication>
  <mapping>
    <mapping-module code="SimpleRoles" type="role">
      <module-option name="jduke@JBOSS.ORG" value="Admin"/>
      <module-option name="hnelson@JBOSS.ORG" value="User"/>
</mapping-module>
  </mapping>
</security-domain>
standalone.xml – Kerberos related system properties
<system-properties>
<property
name="java.security.krb5.conf"
value="/path/to/krb5.conf"/>
<property
name="java.security.krb5.debug"
value="true"/>
<property
name="jboss.security.disable.secdomain.option"
value="true"/>
</system-properties>
Web application configuration
WAR – Web archive
WEB-INF/web.xml
 define your security constraints and roles
<security-constraint>
  <web-resource-collection>
    <web-resource-name>Admin Data</web-resource-name>
    <url-pattern>/admin/*</url-pattern>
  </web-resource-collection>
  <auth-constraint>
    <role-name>Admin</role-name>
  </auth-constraint>
</security-constraint>
<security-role>
  <role-name>Admin</role-name>
</security-role>
 security domain
 custom authenticator
<jboss-web>
<security-domain>SPNEGO</security-domain>
<valve>
        <class name‑ >org.jboss.security.negoti
ation.NegotiationAuthenticator</class-name>
</valve>
</jboss-web>
WEB-INF/jboss-web.xml
META-INF/jboss-deployment-structure.xml
 define module dependencies
<jboss-deployment-structure>
<deployment>
<dependencies>
<module
name="org.jboss.security.negotiation" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Client configuration
krb5.conf
 configure the realm
[libdefaults]
default_realm = MY-COMPANY.CZ
[realms]
MY-COMPANY.CZ = {
kdc = kerberos.my-company.cz:688
}
[domain_realm]
.my-company.cz = MY-COMPANY.CZ
 Use KRB5_CONFIG environment variable if you don't
want to change system wide /etc/krb5.conf
$ export KRB5_CONFIG=/path/to/krb5.conf
Browser configuration – allow negotiation for the domain
 Firefox – use about:config in the address bar
network.negotiate-auth.delegation-uris=.my-company.cz
network.negotiate-auth.trusted-uris =.my-company.cz
 Chromium
$ chromium-browser 
> --auth-server-whitelist=.my-company.cz 
> --auth-negotiate-delegate-whitelist=.my-company.cz
And if it still doesn't work …
Pitfalls – principal names
 The Service Principal Name (SPN) must follow the rule
<service type> / <hostname> @ <realm>
For the request
http://my-server.my-company.cz/
use SPN:
HTTP/my-server.my-company.cz@MYCOMP.CZ
 Mixing IPs and hostnames usually doesn't work:
HTTP/localhost@MYCOMP.CZ
http://127.0.0.1/
Pitfalls - IPv6
 HTTP:
● http://[0:0:0:0:0:0:0:1]:8080/my-app/
● HTTP/[0:0:0:0:0:0:0:1]@JBOSS.ORG
 LDAP (can be used for role-mapping):
● ldap://[0:0:0:0:0:0:0:1]:389
● ldap/0:0:0:0:0:0:0:1@JBOSS.ORG
Pitfalls - IBM Java
 host's login module
<login-module
code="com.ibm.security.auth.module.Krb5LoginModule"
flag="required" >
● module options are not the same!
 krb5.conf – check [libdefaults] section
● encryption support
● default_tgs_enctypes
● default_tkt_enctypes
● allow_weak_crypto
● forwardable ticktet when a client uses Krb5LoginModule
● forwardable = true
Thank you.

More Related Content

PDF
JBoss AS 7 따라잡기
PDF
Undertow 맛보기
PPTX
Introduction to Wildfly 8 - Marchioni
PPTX
Jboss App Server
PDF
JBoss at Work: Using JBoss AS 6
PDF
JBoss Enterprise Application Platform 6 Troubleshooting
PDF
Devoxx 2013, WildFly BOF
PDF
WildFly AppServer - State of the Union
JBoss AS 7 따라잡기
Undertow 맛보기
Introduction to Wildfly 8 - Marchioni
Jboss App Server
JBoss at Work: Using JBoss AS 6
JBoss Enterprise Application Platform 6 Troubleshooting
Devoxx 2013, WildFly BOF
WildFly AppServer - State of the Union

What's hot (20)

PDF
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
PDF
WildFly BOF and V9 update @ Devoxx 2014
PPT
J boss
PPTX
JBoss AS 7
PDF
Introduction to Role Based Administration in WildFly 8
PDF
Turn you Java EE Monoliths into Microservices with WildFly Swarm
PPTX
Javascript Bundling and modularization
PDF
JBoss EAP / WildFly, State of the Union
PDF
JBoss started guide
PDF
JBoss Fuse - Fuse workshop EAP container
KEY
JBoss AS7 Overview
PPTX
Jboss Tutorial Basics
PPTX
JBOSS Training
PDF
Cli jbug
ODP
GlassFish and JavaEE, Today and Future
PDF
Asadmin Webinar 12 Feb 2009
PDF
Jolokia - JMX on Capsaicin (Devoxx 2011)
PDF
Angular2 ecosystem
PDF
Node.js in a heterogeneous system
PDF
Embedding GlassFish v3 in Ehcache Server
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly BOF and V9 update @ Devoxx 2014
J boss
JBoss AS 7
Introduction to Role Based Administration in WildFly 8
Turn you Java EE Monoliths into Microservices with WildFly Swarm
Javascript Bundling and modularization
JBoss EAP / WildFly, State of the Union
JBoss started guide
JBoss Fuse - Fuse workshop EAP container
JBoss AS7 Overview
Jboss Tutorial Basics
JBOSS Training
Cli jbug
GlassFish and JavaEE, Today and Future
Asadmin Webinar 12 Feb 2009
Jolokia - JMX on Capsaicin (Devoxx 2011)
Angular2 ecosystem
Node.js in a heterogeneous system
Embedding GlassFish v3 in Ehcache Server
Ad

Viewers also liked (11)

PPTX
Jar signing
PPTX
Java Secure Coding Practices
PDF
Java Security Manager Reloaded - jOpenSpace Lightning Talk
PPTX
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
PPT
Java security
PPTX
Security Architecture of the Java platform
ODP
OWASP Secure Coding
PDF
CIS14: Best Practices You Must Apply to Secure Your APIs
PPTX
Secure coding practices
PPTX
Deep dive into Java security architecture
PDF
Javantura v4 - Security architecture of the Java platform - Martin Toshev
Jar signing
Java Secure Coding Practices
Java Security Manager Reloaded - jOpenSpace Lightning Talk
Security Architecture of the Java Platform (http://www.javaday.bg event - 14....
Java security
Security Architecture of the Java platform
OWASP Secure Coding
CIS14: Best Practices You Must Apply to Secure Your APIs
Secure coding practices
Deep dive into Java security architecture
Javantura v4 - Security architecture of the Java platform - Martin Toshev
Ad

Similar to JBoss Negotiation in AS7 (20)

PDF
Secure Middleware with JBoss AS 5
PDF
Resource Registries: Plone Conference 2014
KEY
Nodejs web,db,hosting
PDF
As7 web services - JUG Milan April 2012
PDF
Seguranca em APP Rails
PDF
Resource registries plone conf 2014
PDF
Securing Java EE apps using WildFly Elytron
ODP
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
PDF
JBoss AS 7 - YaJUG - nov. 2012
PDF
JBoss AS7 web services
PDF
JBoss AS7 Webservices
PDF
BP-6 Repository Customization Best Practices
PDF
Год в Github bugbounty, опыт участия
ODP
Signature verification of kernel module and kexec
PDF
Cloud Best Practices
PDF
vert.x 소개 및 개발 실습
PDF
Node.js vs Play Framework
PPT
Java 6 [Mustang] - Features and Enchantments
PPTX
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
PDF
April 2010 - JBoss Web Services
Secure Middleware with JBoss AS 5
Resource Registries: Plone Conference 2014
Nodejs web,db,hosting
As7 web services - JUG Milan April 2012
Seguranca em APP Rails
Resource registries plone conf 2014
Securing Java EE apps using WildFly Elytron
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
JBoss AS 7 - YaJUG - nov. 2012
JBoss AS7 web services
JBoss AS7 Webservices
BP-6 Repository Customization Best Practices
Год в Github bugbounty, опыт участия
Signature verification of kernel module and kexec
Cloud Best Practices
vert.x 소개 및 개발 실습
Node.js vs Play Framework
Java 6 [Mustang] - Features and Enchantments
Nagios Conference 2014 - Jeff Mendoza - Monitoring Microsoft Azure with Nagios
April 2010 - JBoss Web Services

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
A Presentation on Artificial Intelligence
PDF
Empathic Computing: Creating Shared Understanding
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Tartificialntelligence_presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
cloud_computing_Infrastucture_as_cloud_p
A comparative study of natural language inference in Swahili using monolingua...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25-Week II
A Presentation on Artificial Intelligence
Empathic Computing: Creating Shared Understanding
gpt5_lecture_notes_comprehensive_20250812015547.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction
Assigned Numbers - 2025 - Bluetooth® Document
Tartificialntelligence_presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
OMC Textile Division Presentation 2021.pptx

JBoss Negotiation in AS7

  • 1. JBoss Negotiation in AS7 Get Kerberos authentication working Josef Cacek Senior QE Engineer, Red Hat DevConf 2013
  • 2. Agenda  Technologies introduction  Quickstart  Configuration  Troubleshooting
  • 4. Introduction: Kerberos  ticket based network authentication protocol
  • 5. JBoss Negotiation  Negotiation (SPNEGO) support for JBoss AS ● protocols ● Kerberos ● NTLM ● components ● authenticator – a JBoss Web valve ● JAAS Login modules ● toolkit to check the configuration
  • 8. standalone.xml – security domains (1) <security-domain name="host" cache-type="default"> <authentication>     <login-module code="Kerberos" flag="required">       <module-option name="debug" value="true"/>       <module-option name="storeKey" value="true"/>       <module-option name="refreshKrb5Config" value="true"/>       <module-option name="useKeyTab" value="true"/>       <module-option name="doNotPrompt" value="true"/>       <module option ‑ name="keyTab"         value="/path/to/http.keytab"/>       <module-option name="principal"         value="HTTP/[email protected]"/>     </login-module>   </authentication> </security-domain>
  • 9. standalone.xml – security domains (2) <security-domain name="SPNEGO" cache-type="default"> <authentication>     <login-module code="SPNEGO" flag="required">       <module-option name="serverSecurityDomain"         value="host"/>     </login-module>   </authentication>   <mapping>     <mapping-module code="SimpleRoles" type="role">       <module-option name="[email protected]" value="Admin"/>       <module-option name="[email protected]" value="User"/> </mapping-module>   </mapping> </security-domain>
  • 10. standalone.xml – Kerberos related system properties <system-properties> <property name="java.security.krb5.conf" value="/path/to/krb5.conf"/> <property name="java.security.krb5.debug" value="true"/> <property name="jboss.security.disable.secdomain.option" value="true"/> </system-properties>
  • 12. WAR – Web archive
  • 13. WEB-INF/web.xml  define your security constraints and roles <security-constraint>   <web-resource-collection>     <web-resource-name>Admin Data</web-resource-name>     <url-pattern>/admin/*</url-pattern>   </web-resource-collection>   <auth-constraint>     <role-name>Admin</role-name>   </auth-constraint> </security-constraint> <security-role>   <role-name>Admin</role-name> </security-role>
  • 14.  security domain  custom authenticator <jboss-web> <security-domain>SPNEGO</security-domain> <valve>         <class name‑ >org.jboss.security.negoti ation.NegotiationAuthenticator</class-name> </valve> </jboss-web> WEB-INF/jboss-web.xml
  • 15. META-INF/jboss-deployment-structure.xml  define module dependencies <jboss-deployment-structure> <deployment> <dependencies> <module name="org.jboss.security.negotiation" /> </dependencies> </deployment> </jboss-deployment-structure>
  • 17. krb5.conf  configure the realm [libdefaults] default_realm = MY-COMPANY.CZ [realms] MY-COMPANY.CZ = { kdc = kerberos.my-company.cz:688 } [domain_realm] .my-company.cz = MY-COMPANY.CZ  Use KRB5_CONFIG environment variable if you don't want to change system wide /etc/krb5.conf $ export KRB5_CONFIG=/path/to/krb5.conf
  • 18. Browser configuration – allow negotiation for the domain  Firefox – use about:config in the address bar network.negotiate-auth.delegation-uris=.my-company.cz network.negotiate-auth.trusted-uris =.my-company.cz  Chromium $ chromium-browser > --auth-server-whitelist=.my-company.cz > --auth-negotiate-delegate-whitelist=.my-company.cz
  • 19. And if it still doesn't work …
  • 20. Pitfalls – principal names  The Service Principal Name (SPN) must follow the rule <service type> / <hostname> @ <realm> For the request http://my-server.my-company.cz/ use SPN: HTTP/[email protected]  Mixing IPs and hostnames usually doesn't work: HTTP/[email protected] http://127.0.0.1/
  • 21. Pitfalls - IPv6  HTTP: ● http://[0:0:0:0:0:0:0:1]:8080/my-app/ ● HTTP/[0:0:0:0:0:0:0:1]@JBOSS.ORG  LDAP (can be used for role-mapping): ● ldap://[0:0:0:0:0:0:0:1]:389 ● ldap/0:0:0:0:0:0:0:[email protected]
  • 22. Pitfalls - IBM Java  host's login module <login-module code="com.ibm.security.auth.module.Krb5LoginModule" flag="required" > ● module options are not the same!  krb5.conf – check [libdefaults] section ● encryption support ● default_tgs_enctypes ● default_tkt_enctypes ● allow_weak_crypto ● forwardable ticktet when a client uses Krb5LoginModule ● forwardable = true