cas enhancement

42
Albert Guo [email protected]

Upload: guo-albert

Post on 19-Jun-2015

1.881 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: CAS Enhancement

Albert [email protected]

Page 2: CAS Enhancement

Why SSO (Single-Sign On)? Central Authentication Service (CAS) CAS Installation As-Is and To-be Process Modification Process

Page 3: CAS Enhancement
Page 4: CAS Enhancement
Page 5: CAS Enhancement

web browser

app. #1 app. #2 app. #3

without SSO

service

web browser

app. #1 app. #2 app. #3

with SSO

service

Page 6: CAS Enhancement

One authentication serverOne authentication server

•From applications to the authentication server (when not authenticated)•From the authentication server to applications (when authenticated)

•From applications to the authentication server (when not authenticated)•From the authentication server to applications (when authenticated)

Cookies, CGI parametersCookies, CGI parameters

Page 7: CAS Enhancement
Page 8: CAS Enhancement

Security◦ Password is never transmitted to applications◦ Opaque tickets are used

N-tier installations◦ Without transmitting any password!

Portability (client libraries)◦ Java, Perl, JSP, ASP, PHP, PL/SQL, Apache and PAM

modules Permanence

◦ Developed by Yale University◦ World-wide used (mainly Universities)◦ Adopted by all the French educational community

Page 9: CAS Enhancement

J2EE platform◦ Very light code (about 1000 lines)

Open source Integrated into uPortal

Page 10: CAS Enhancement
Page 11: CAS Enhancement

CAS 3 offers…◦ CAS 2 compliance out of the box◦ Unit/Integration Tests and Compliance Tests◦ Proper domain model◦ Revamped architecture◦ Support for well-known modifications

Page 12: CAS Enhancement

Built on popular open-source frameworks◦ Spring Framework◦ Quartz◦ xFire◦ Jakarta Commons◦ Log4j◦ Maven

Design Philosophy: don’t reinvent the wheel

Page 13: CAS Enhancement

Loose coupling of components◦ Via Dependency Injection◦ Declarative configuration via XML files

Coding to interfaces◦ Swap implementations to suite needs◦ Implementations adhere to contract◦ Example: TicketRegistry

Uses Design Patterns◦ Patterns allow for a common understanding◦ Example: Template Design Pattern

Page 14: CAS Enhancement

Layered Architecture◦ Separation of UI concerns from business concerns◦ Allows for better re-use of code◦ Example: Web Tier vs. Web Service

Use of AOP to separate cross-cutting concerns for business logic◦ Allows for major additions to functionality without

modifying core code◦ Example: auditing

Use of Spring Workflow allows for declarative reconfiguration of Login process

Page 15: CAS Enhancement

SSO solution from Yale University

◦ http://www.ja-sig.org/products/cas/index.html

Authentication once to access multiple applications

An open and well-documented protocol

A library of clients for Java, PHP, Perl, Apache and …

Page 16: CAS Enhancement

Service 2Service 2

Resource Resource

CASCAS

Login Validate

Service 1Service 1

Resource Resource 1. Initial request

2. Authentication (send serviceId)

3. Ticket transfer (send ticket)

4. Validate Ticket5. Access resource

encrypted cookie

SSO make it possible for users to login once and access different service

SSO make it possible for users to login once and access different service

PW

Page 17: CAS Enhancement

Service 2Service 2

Resource Resource

CASCAS

Login Validate

Service 1Service 1

Resource Resource

1. Initial request

2. Authentication (send serviceId)

3. Ticket transfer (send ticket)

4. Validate Ticket

5. Access resource

encrypted cookie

2a. User need NOT to provide id/password again ( with SSO cookie exist)

Page 18: CAS Enhancement

Service 1Service 1

ResourceResource1. Initial request

loginlogin

2. Authentication

3. Access resource

Service 2Service 2

loginlogin

Resource Resource

2. Authentication again

1. Initial request

3. Access resource

Multiple user databaseMultiple loginMultiple user databaseMultiple login

PW

PW

Page 19: CAS Enhancement

Service 2Service 2

Resource Resource

CASCAS

Login Validate

Service 1Service 1

Resource Resource 1. Initial request

2. Authentication (send serviceId)

3. Ticket transfer (send ticket)

4. Validate Ticket

5. Access resource

encrypted cookie

SSO make it possible for users to login once and access different service

SSO make it possible for users to login once and access different service

PW

Page 20: CAS Enhancement

Service 2Service 2

Resource Resource

CASCAS

Login Validate

Service 1Service 1

Resource Resource

1. Initial request

2. Authentication (send serviceId)

3. Ticket transfer (send ticket)

4. Validate Ticket

5. Access resource

encrypted cookie

2a. User does NOT need to provide id/password again ( with SSO cookie exist)

Page 21: CAS Enhancement

ServiceService

CASCAS

Login state

?

ID and Passwor

dCorrect?

Validation url

Initial request

Redirect to CAS (send serviceId)

Y

N

NLogin again

Id and password

Ticket transfer (Send ticket and set SSO cookie)

Ticket Validat

ion

Use resource

N

Save login state

Y

Y

Ticket validation

Page 22: CAS Enhancement
Page 23: CAS Enhancement
Page 24: CAS Enhancement
Page 25: CAS Enhancement

You will get this kind of error message as you access the CAS login page: org.apache.jasper.JasperException: /WEB-INF/view/jsp/default/ui/casLoginView.jsp(48,35) Attribute value request.getQueryString() == null ? "" : request.getQueryString().replaceAll("&locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]|^locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]", "") is quoted with " which must be escaped when used within the value◦ Apparently Tomcat changed the way they handle quotation

marks in JSP pages to use strict checking: https://issues.apache.org/bugzilla/show_bug.cgi?id=45015

Page 26: CAS Enhancement

Temp solution: go to Tomcat 5.5\webapps\cas-server-webapp-3.2\WEB-INF\view\jsp\default\ui, and modify casLoginView.jsp, delete line 48:

Page 27: CAS Enhancement

Just provide same user name and password, then you can pass the validationJust provide same user name and password, then you can pass the validation

Page 28: CAS Enhancement
Page 29: CAS Enhancement
Page 30: CAS Enhancement
Page 31: CAS Enhancement
Page 32: CAS Enhancement
Page 33: CAS Enhancement
Page 34: CAS Enhancement

Modify this return pageModify this return page

Page 35: CAS Enhancement

Find mapping servlet controller from applicationCotext.xml

Create a new login successful page Modification principal

◦ Modified the server side API instead of client side. Therefore, client will not need to any modification.

◦ Just use new a URL pattern, ex. serviceValidateByMail, to let servlet controller to do validation and return to new successful login page.

Page 36: CAS Enhancement
Page 37: CAS Enhancement
Page 38: CAS Enhancement
Page 39: CAS Enhancement
Page 40: CAS Enhancement

Add one more view property◦ casServiceSuccessViewByMail.

(class)=org.springframework.web.servlet.view.JstlView◦ casServiceSuccessViewByMail.url=/WEB-INF/view/jsp/protocol/

2.0/casServiceValidationByMailSuccess.jsp

Page 41: CAS Enhancement

In org.jasig.cas.web packageIn org.jasig.cas.web package

Page 42: CAS Enhancement