Skip to content

lkrzyzanek/cas-jaas-ee6-integration-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAS JAAS Integration Java EE 6 Example

This example shows how Java EE 6 app (JBoss AS 7 resp. EAP 6.2) can be integrated with CAS Single Sign On server.

In Addition to the CAS integration it shows how to write simple JAAS Login Module.

Example demonstrates securing:

  • JAX-RS REST via @PermitAll resp. @RolesAllowed annotations
  • Servlet via @ServletSecurity

After deployment you get:

  • / - main page with information about currently logged in user
  • Filter which examine HTTP Basic authentication. If present then triggers JAAS login.
  • /login/cas - single point for login to CAS server
  • /secured-servlet - secured servlet via @ServletSecurity annotation
  • /rest/test/public - public REST api
  • /rest/test/secure - secured REST api

Test Snippets

Test secured content without authentication

	curl http://localhost:8080/rest/test/secure
	output:
	401

Test secured content with authentication

	curl -u username:password http://localhost:8080/rest/test/secure
	output:
	OK, principal from security context: username

Test public content

	curl http://localhost:8080/rest/test/public
	output:
	OK PUBLIC

Configuration

Add Security Domain CasSecurityDomain to AS. See JBoss AS 7 / EAP 6.2 example in .openshift/config/standalone.xml

Resources

About

Example how to secure Java EE 6 application by Jasig CAS server via JAAS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published