1 |
|
/*
|
|
1 |
|
/*
|
|
1 |
|
/*
|
2 |
|
* License
d to the A
pache Soft
ware Found
ation (ASF
) under on
e or more
|
|
2 |
|
* License
d to the A
pache Soft
ware Found
ation (ASF
) under on
e or more
|
|
2 |
|
* License
d to the A
pache Soft
ware Found
ation (ASF
) under on
e or more
|
3 |
|
* contrib
utor licen
se agreeme
nts. See
the NOTICE
file dist
ributed wi
th
|
|
3 |
|
* contrib
utor licen
se agreeme
nts. See
the NOTICE
file dist
ributed wi
th
|
|
3 |
|
* contrib
utor licen
se agreeme
nts. See
the NOTICE
file dist
ributed wi
th
|
4 |
|
* this wo
rk for add
itional in
formation
regarding
copyright
ownership.
|
|
4 |
|
* this wo
rk for add
itional in
formation
regarding
copyright
ownership.
|
|
4 |
|
* this wo
rk for add
itional in
formation
regarding
copyright
ownership.
|
5 |
|
* The ASF
licenses
this file
to You und
er the Apa
che Licens
e, Version
2.0
|
|
5 |
|
* The ASF
licenses
this file
to You und
er the Apa
che Licens
e, Version
2.0
|
|
5 |
|
* The ASF
licenses
this file
to You und
er the Apa
che Licens
e, Version
2.0
|
6 |
|
* (the "L
icense");
you may no
t use this
file exce
pt in comp
liance wit
h
|
|
6 |
|
* (the "L
icense");
you may no
t use this
file exce
pt in comp
liance wit
h
|
|
6 |
|
* (the "L
icense");
you may no
t use this
file exce
pt in comp
liance wit
h
|
7 |
|
* the Lic
ense. You
may obtai
n a copy o
f the Lice
nse at
|
|
7 |
|
* the Lic
ense. You
may obtai
n a copy o
f the Lice
nse at
|
|
7 |
|
* the Lic
ense. You
may obtai
n a copy o
f the Lice
nse at
|
8 |
|
*
|
|
8 |
|
*
|
|
8 |
|
*
|
9 |
|
* ht
tp://www.a
pache.org/
licenses/L
ICENSE-2.0
|
|
9 |
|
* ht
tp://www.a
pache.org/
licenses/L
ICENSE-2.0
|
|
9 |
|
* ht
tp://www.a
pache.org/
licenses/L
ICENSE-2.0
|
10 |
|
*
|
|
10 |
|
*
|
|
10 |
|
*
|
11 |
|
* Unless
required b
y applicab
le law or
agreed to
in writing
, software
|
|
11 |
|
* Unless
required b
y applicab
le law or
agreed to
in writing
, software
|
|
11 |
|
* Unless
required b
y applicab
le law or
agreed to
in writing
, software
|
12 |
|
* distrib
uted under
the Licen
se is dist
ributed on
an "AS IS
" BASIS,
|
|
12 |
|
* distrib
uted under
the Licen
se is dist
ributed on
an "AS IS
" BASIS,
|
|
12 |
|
* distrib
uted under
the Licen
se is dist
ributed on
an "AS IS
" BASIS,
|
13 |
|
* WITHOUT
WARRANTIE
S OR CONDI
TIONS OF A
NY KIND, e
ither expr
ess or imp
lied.
|
|
13 |
|
* WITHOUT
WARRANTIE
S OR CONDI
TIONS OF A
NY KIND, e
ither expr
ess or imp
lied.
|
|
13 |
|
* WITHOUT
WARRANTIE
S OR CONDI
TIONS OF A
NY KIND, e
ither expr
ess or imp
lied.
|
14 |
|
* See the
License f
or the spe
cific lang
uage gover
ning permi
ssions and
|
|
14 |
|
* See the
License f
or the spe
cific lang
uage gover
ning permi
ssions and
|
|
14 |
|
* See the
License f
or the spe
cific lang
uage gover
ning permi
ssions and
|
15 |
|
* limitat
ions under
the Licen
se.
|
|
15 |
|
* limitat
ions under
the Licen
se.
|
|
15 |
|
* limitat
ions under
the Licen
se.
|
16 |
|
*/
|
|
16 |
|
*/
|
|
16 |
|
*/
|
17 |
|
package or
g.apache.c
atalina.au
thenticato
r;
|
|
17 |
|
package or
g.apache.c
atalina.au
thenticato
r;
|
|
17 |
|
package or
g.apache.c
atalina.au
thenticato
r;
|
18 |
|
|
|
18 |
|
|
|
18 |
|
|
19 |
|
import jav
a.io.Seria
lizable;
|
|
19 |
|
import jav
a.io.Seria
lizable;
|
|
19 |
|
import jav
a.io.Seria
lizable;
|
20 |
|
|
|
20 |
|
|
|
20 |
|
|
21 |
|
import org
.apache.ca
talina.Aut
henticator
;
|
|
21 |
|
import org
.apache.ca
talina.Aut
henticator
;
|
|
21 |
|
import org
.apache.ca
talina.Aut
henticator
;
|
22 |
|
import org
.apache.ca
talina.Con
text;
|
|
22 |
|
import org
.apache.ca
talina.Con
text;
|
|
22 |
|
import org
.apache.ca
talina.Con
text;
|
23 |
|
import org
.apache.ca
talina.Man
ager;
|
|
23 |
|
import org
.apache.ca
talina.Man
ager;
|
|
23 |
|
import org
.apache.ca
talina.Man
ager;
|
24 |
|
import org
.apache.ca
talina.Ses
sion;
|
|
24 |
|
import org
.apache.ca
talina.Ses
sion;
|
|
24 |
|
import org
.apache.ca
talina.Ses
sion;
|
25 |
|
import org
.apache.ca
talina.Ses
sionEvent;
|
|
25 |
|
import org
.apache.ca
talina.Ses
sionEvent;
|
|
25 |
|
import org
.apache.ca
talina.Ses
sionEvent;
|
26 |
|
import org
.apache.ca
talina.Ses
sionListen
er;
|
|
26 |
|
import org
.apache.ca
talina.Ses
sionListen
er;
|
|
26 |
|
import org
.apache.ca
talina.Ses
sionListen
er;
|
27 |
|
|
|
27 |
|
|
|
27 |
|
|
28 |
|
public cla
ss SingleS
ignOnListe
ner implem
ents Sessi
onListener
, Serializ
able {
|
|
28 |
|
public cla
ss SingleS
ignOnListe
ner implem
ents Sessi
onListener
, Serializ
able {
|
|
28 |
|
public cla
ss SingleS
ignOnListe
ner implem
ents Sessi
onListener
, Serializ
able {
|
29 |
|
|
|
29 |
|
|
|
29 |
|
|
30 |
|
privat
e static f
inal long
serialVers
ionUID = 1
L;
|
|
30 |
|
privat
e static f
inal long
serialVers
ionUID = 1
L;
|
|
30 |
|
privat
e static f
inal long
serialVers
ionUID = 1
L;
|
31 |
|
|
|
31 |
|
|
|
31 |
|
|
32 |
|
privat
e final St
ring ssoId
;
|
|
32 |
|
privat
e final St
ring ssoId
;
|
|
32 |
|
privat
e final St
ring ssoId
;
|
33 |
|
|
|
33 |
|
|
|
33 |
|
|
34 |
|
public
SingleSig
nOnListene
r(String s
soId) {
|
|
34 |
|
public
SingleSig
nOnListene
r(String s
soId) {
|
|
34 |
|
public
SingleSig
nOnListene
r(String s
soId) {
|
35 |
|
th
is.ssoId =
ssoId;
|
|
35 |
|
th
is.ssoId =
ssoId;
|
|
35 |
|
th
is.ssoId =
ssoId;
|
36 |
|
}
|
|
36 |
|
}
|
|
36 |
|
}
|
37 |
|
|
|
37 |
|
|
|
37 |
|
|
38 |
|
|
|
38 |
|
|
|
38 |
|
|
39 |
|
@Overr
ide
|
|
39 |
|
@Overr
ide
|
|
39 |
|
@Overr
ide
|
40 |
|
public
void sess
ionEvent(S
essionEven
t event) {
|
|
40 |
|
public
void sess
ionEvent(S
essionEven
t event) {
|
|
40 |
|
public
void sess
ionEvent(S
essionEven
t event) {
|
41 |
|
if
(!Session
.SESSION_D
ESTROYED_E
VENT.equal
s(event.ge
tType()))
{
|
|
41 |
|
if
(!Session
.SESSION_D
ESTROYED_E
VENT.equal
s(event.ge
tType()))
{
|
|
41 |
|
if
(!Session
.SESSION_D
ESTROYED_E
VENT.equal
s(event.ge
tType()))
{
|
42 |
|
return;
|
|
42 |
|
return;
|
|
42 |
|
return;
|
43 |
|
}
|
|
43 |
|
}
|
|
43 |
|
}
|
44 |
|
|
|
44 |
|
|
|
44 |
|
|
45 |
|
Se
ssion sess
ion = even
t.getSessi
on();
|
|
45 |
|
Se
ssion sess
ion = even
t.getSessi
on();
|
|
45 |
|
Se
ssion sess
ion = even
t.getSessi
on();
|
46 |
|
Ma
nager mana
ger = sess
ion.getMan
ager();
|
|
46 |
|
Ma
nager mana
ger = sess
ion.getMan
ager();
|
|
46 |
|
Ma
nager mana
ger = sess
ion.getMan
ager();
|
47 |
|
if
(manager
== null) {
|
|
47 |
|
if
(manager
== null) {
|
|
47 |
|
if
(manager
== null) {
|
48 |
|
return;
|
|
48 |
|
return;
|
|
48 |
|
return;
|
49 |
|
}
|
|
49 |
|
}
|
|
49 |
|
}
|
50 |
|
Co
ntext cont
ext = mana
ger.getCon
text();
|
|
50 |
|
Co
ntext cont
ext = mana
ger.getCon
text();
|
|
50 |
|
Co
ntext cont
ext = mana
ger.getCon
text();
|
51 |
|
Au
thenticato
r authenti
cator = co
ntext.getA
uthenticat
or();
|
|
51 |
|
Au
thenticato
r authenti
cator = co
ntext.getA
uthenticat
or();
|
|
51 |
|
Au
thenticato
r authenti
cator = co
ntext.getA
uthenticat
or();
|
52 |
|
if
(!(authen
ticator in
stanceof A
uthenticat
orBase)) {
|
|
52 |
|
if
(!(authen
ticator in
stanceof A
uthenticat
orBase)) {
|
|
52 |
|
if
(!(authen
ticator in
stanceof A
uthenticat
orBase)) {
|
53 |
|
return;
|
|
53 |
|
return;
|
|
53 |
|
return;
|
54 |
|
}
|
|
54 |
|
}
|
|
54 |
|
}
|
55 |
|
Si
ngleSignOn
sso = ((A
uthenticat
orBase) au
thenticato
r).sso;
|
|
55 |
|
Si
ngleSignOn
sso = ((A
uthenticat
orBase) au
thenticato
r).sso;
|
|
55 |
|
Si
ngleSignOn
sso = ((A
uthenticat
orBase) au
thenticato
r).sso;
|
56 |
|
if
(sso == n
ull) {
|
|
56 |
|
if
(sso == n
ull) {
|
|
56 |
|
if
(sso == n
ull) {
|
57 |
|
return;
|
|
57 |
|
return;
|
|
57 |
|
return;
|
58 |
|
}
|
|
58 |
|
}
|
|
58 |
|
}
|
59 |
|
ss
o.sessionD
estroyed(s
soId, sess
ion);
|
|
59 |
|
ss
o.sessionD
estroyed(s
soId, sess
ion);
|
|
59 |
|
ss
o.sessionD
estroyed(s
soId, sess
ion);
|
60 |
|
}
|
|
60 |
|
}
|
|
60 |
|
}
|
61 |
|
}
|
|
61 |
|
}
|
|
61 |
|
}
|