Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Steve's

...

Guide

...

to

...

Upgrading

...

from

...

Acegi

...

to

...

Spring

...

Security

...

This

...

document

...

is

...

a

...

guide

...

for

...

upgrading

...

an

...

Education

...

Systems

...

app

...

from

...

Acegi

...

Security

...

to

...

Spring

...

Security,

...

based

...

on

...

the

...

IAP

...

application

...

upgrade.

...

There

...

are

...

two

...

parts,

...

one

...

for

...

the

...

jar-file

...

project

...

upgrade

...

and

...

one

...

for

...

the

...

web

...

app

...

upgrade.

...

1.

...

Jar

...

File

...

Project

...

Upgrade

...

By

...

"jar

...

file

...

project

...

"

...

I

...

mean

...

a

...

project

...

that

...

is

...

not

...

a

...

web

...

application

...

-

...

for

...

example,

...

the

...

csf-iap

...

project.

...

1.1

...

The

...

pom

...

file

...

Under

...

the

...

"csf-security"

...

dependency,

...

remove

...

the

...

exclusions

...

for

...

Spring

...

Security

...

and

...

add

...

an

...

exclusion

...

for

...

Acegi.

...

The

...

Aegi

...

exclusion

...

looks

...

like

...

this:

{
Code Block
}
<exclusion>
    <artifactId>acegi-security</artifactId>
    <groupId>org.acegisecurity</groupId>
</exclusion>
{code}

The

...

CSF

...

Security

...

module

...

includes

...

dependencies

...

for

...

Spring

...

Security,

...

so

...

there

...

is

...

no

...

need

...

to

...

include

...

them

...

in

...

your

...

project.

...

1.2

...

Java

...

Code

...

a)

...

All

...

references

...

to

...

acegi

...

classes

...

were

...

replaced

...

by

...

references

...

to

...

Spring

...

Security

...

classes.

...

In

...

most

...

cases,

...

these

...

were

...

upgraded

...

by

...

changing

...

the

...

import

...

statements'

...

package

...

names.

...

e.g:

...

org.acegisecurity.context.SecurityContextHolder

...

changes

...

to

...

org.springframework.security.core.context.SecurityContextHolder

...

Eclipse

...

handled

...

these

...

changes

...

nicely

...

-

...

I

...

did

...

a

...

global

...

search

...

in

...

the

...

Java

...

code

...

for

...

"acegi",

...

deleted

...

any

...

imports

...

that

...

referenced

...

org.acegisecurity

...

package

...

names,and

...

then

...

used

...

Eclipse's

...

"Organize

...

Imports"

...

feature

...

to

...

pull

...

in

...

the

...

correct

...

Spring

...

Security

...

imports.

...

b)

...

Some

...

interfaces

...

have

...

changed

...

slightly

...

with

...

Spring

...

Security

...

-

...

in

...

particular,

...

rather

...

than

...

the

...

Acegi

...

practice

...

of

...

using

...

arrays,

...

Spring

...

Security

...

uses

...

Collections.

...

This

...

requires

...

some

...

code

...

changes

...

(e.g.

...

we

...

now

...

use

...

size()

...

to

...

determine

...

how

...

many

...

elements

...

are

...

in

...

the

...

collection

...

rather

...

than

...

length()).

...

c)

...

Some

...

class

...

names

...

changed

...

between

...

Spring

...

Sec

...

2.0

...

&

...

3.0.

...

These

...

are

...

documented

...

here:

...

http://git.springsource.org/~rwinch/spring-security/rwinchs-spring-security/blobs/3.0.x/class_mapping_from_2.0.x.txt

...

An

...

example

...

is

...

BasicProcessingFilter

...

which

...

was

...

renamed

...

to

...

BasicAuthenticationFilter.

...

d)

...

References

...

to

...

the

...

Acegi

...

portion

...

of

...

CSF

...

Security

...

changed

...

to

...

the

...

Spring

...

Security

...

portion

...

of

...

CSF,

...

e.g.:

...

edu.mit.csf.security.acegi.MitGrantedAuthority

...

changes

...

to

...

edu.mit.csf.security.spring.MitGrantedAuthority

...

.

...

e)

...

References

...

to

...

the

...

CSF

...

Security

...

Acegi

...

XML

...

configuration

...

changed

...

to

...

the

...

Spring

...

XML

...

configuration:

...

applicationContext-csf-security-acegi.xml

...

changes

...

to

...

applicationContext-csf-security-spring.xml

...

.

...

1.3

...

XML

...

Configuration

...

Files

...

Some

...

of

...

the

...

csf-iap

...

XML

...

files

...

used

...

to

...

configure

...

Spring

...

had

...

Acegi

...

references

...

which

...

needed

...

to

...

be

...

updated:

...

a)

...

All

...

references

...

to

...

acegi

...

classes

...

were

...

replaced

...

by

...

references

...

to

...

the

...

equivalent

...

Spring

...

Security

...

classes

...

as

...

described

...

above.

...

b)

...

References

...

to

...

the

...

CSF

...

Security

...

Acegi

...

XML

...

configuration

...

changed

...

to

...

the

...

Spring

...

XML

...

configuration

...

as

...

described

...

above.

...

2.

...

Web

...

Project

...

Upgrade

...

This

...

section

...

describes

...

the

...

changes

...

needed

...

for

...

a

...

web

...

project

...

(e.g.

...

iap-web).

...

2.1

...

The

...

pom

...

File

...

No

...

changes

...

were

...

necessary

...

-

...

all

...

dependency

...

changes

...

were

...

taken

...

care

...

of

...

by

...

the

...

changes

...

to

...

the

...

Jar

...

file

...

project

...

(csf-iap

...

in

...

my

...

case).

...

2.2

...

Java

...

Code

...

All

...

references

...

to

...

Acegi

...

classes

...

were

...

removed.

...

For

...

iap-web

...

I

...

was

...

able

...

to

...

remove

...

reference

...

to

...

Acegi

...

or

...

Spring

...

security

...

altogether

...

by

...

using

...

our

...

SecurityContextService

...

interface

...

instead.

...

This

...

interface

...

provides

...

an

...

abstraction

...

barrier

...

between

...

our

...

code

...

and

...

the

...

security

...

subsystem

...

(Acegi/Spring)

...

and

...

should

...

be

...

used

...

instead

...

of

...

core

...

Spring

...

Security

...

classes

...

wherever

...

possible.

...

2.3

...

XML

...

Configuration

...

Files

...

a)

...

The

...

security

...

XML

...

config

...

file

...

(applicationContext-iap-security.xml)

...

needed

...

an

...

overhaul:

...

  1. Spring

...

  1. Security

...

  1. XML

...

  1. schema

...

  1. locations

...

  1. added

...

  1. to

...

  1. <beans>

...

  1. tag.

...

  1. In

...

  1. fact

...

  1. the

...

  1. whole

...

  1. XML

...

  1. file

...

  1. was

...

  1. modernized,

...

  1. removing

...

  1. the

...

  1. older

...

  1. DOCTYPE

...

  1. declaration.

...

  1. The

...

  1. filterChainProxy

...

  1. bean

...

  1. declaration

...

  1. was

...

  1. changed

...

  1. to

...

  1. the

...

  1. Spring

...

  1. Security

...

  1. format. 
  2. Converted filterSecurityInterceptor config to new format.
  3. All references to acegi classes were replaced by references to the equivalent Spring Security classes as described above.

...

2.4 JSP Tags

...

The <authz> tags have been replaced by <security> tags. In some cases, the tag interfaces have changed. e.g. e.g.:

Code Block
&nbsp;
# Converted _filterSecurityInterceptor_ config to new format.
# All references to acegi classes were replaced by references to the equivalent Spring Security classes as described above.

h6. 2.4 JSP Tags

The <authz> tags have been replaced by <security> tags. In some cases, the tag interfaces have changed. e.g. e.g.:
{code}
      <authz:authentication operation="username"/>
{code}

changes

...

to

{
Code Block
}
      <security:authentication property="principal.username"/>
{code}

So

...

in

...

all

...

JSPs,

...

<auth>

...

tags

...

must

...

change

...

to

...

<security>

...

tags.

...

b)

...

The

...

authz.tld

...

file

...

was

...

removed

...

from

...

the

...

project.

...

c)

...

In

...

the

...

taglibs.include

...

file

...

we

...

replaced

{
Code Block
}
<%@taglib uri="/WEB-INF/authz.tld" prefix="authz" %>
{code

with

Code Block
}
with
{code}
<%@taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
{code}

h6. 
2.5

...

web.xml

...

a)

...

Spring

...

container

...

config

...

-

...

we

...

now

...

refer

...

to

...

classpath*:applicationContext-csf-security-spring.xml

...

and  classpath*:applicationContext-csf-security-spring.xml

...

b)

...

Spring

...

Security

...

config

...

-

...

replaced

...

filter-name

...

"acegi"

...

with

...

filter

...

name

...

"filterChainProxy",

...

  class

...

org.springframework.web.filter.DelegatingFilterProxy