Produced by Araxis Merge on 11/20/2017 2:16:16 PM GMT Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | Mon Nov 20 14:16:16 2017 UTC | ||
2 | C:\Merge Test Files\8.5.23\java\org\apache\catalina\authenticator\jaspic | SimpleServerAuthContext.java | Thu Sep 28 11:32:16 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 0 | 0 |
Changed | 0 | 0 |
Inserted | 1 | 74 |
Removed | 0 | 0 |
Whitespace | Consecutive whitespace is treated as a single space |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | /** | |||||
2 | * Licens ed to the Apache Sof tware Foun dation (AS F) under o ne or more | |||||
3 | * contri butor lice nse agreem ents. See the NOTIC E file dis tributed w ith | |||||
4 | * this w ork for ad ditional i nformation regarding copyright ownership . | |||||
5 | * The AS F licenses this file to You un der the Ap ache Licen se, Versio n 2.0 | |||||
6 | * (the " License"); you may n ot use thi s file exc ept in com pliance wi th | |||||
7 | * the Li cense. Yo u may obta in a copy of the Lic ense at | |||||
8 | * | |||||
9 | * htt p://www.ap ache.org/l icenses/LI CENSE-2.0 | |||||
10 | * | |||||
11 | * Unless required by applica ble law or agreed to in writin g, softwar e | |||||
12 | * distri buted unde r the Lice nse is dis tributed o n an "AS I S" BASIS, | |||||
13 | * WITHOU T WARRANTI ES OR COND ITIONS OF ANY KIND, either exp ress or im plied. | |||||
14 | * See th e License for the sp ecific lan guage gove rning perm issions an d | |||||
15 | * limita tions unde r the Lice nse. | |||||
16 | */ | |||||
17 | package or g.apache.c atalina.au thenticato r.jaspic; | |||||
18 | ||||||
19 | import jav a.util.Lis t; | |||||
20 | ||||||
21 | import jav ax.securit y.auth.Sub ject; | |||||
22 | import jav ax.securit y.auth.mes sage.AuthE xception; | |||||
23 | import jav ax.securit y.auth.mes sage.AuthS tatus; | |||||
24 | import jav ax.securit y.auth.mes sage.Messa geInfo; | |||||
25 | import jav ax.securit y.auth.mes sage.confi g.ServerAu thContext; | |||||
26 | import jav ax.securit y.auth.mes sage.modul e.ServerAu thModule; | |||||
27 | ||||||
28 | /** | |||||
29 | * Basic i mplementat ion primar ily intend ed for use when usin g third-pa rty | |||||
30 | * {@link ServerAuth Module} im plementati ons that o nly provid e the modu le. This | |||||
31 | * impleme ntation su pports mul tiple modu les and wi ll treat t he user as | |||||
32 | * authent icated if any one mo dule is ab le to auth enticate t he user. | |||||
33 | */ | |||||
34 | public cla ss SimpleS erverAuthC ontext imp lements Se rverAuthCo ntext { | |||||
35 | ||||||
36 | privat e final Li st<ServerA uthModule> modules; | |||||
37 | ||||||
38 | ||||||
39 | public SimpleSer verAuthCon text(List< ServerAuth Module> mo dules) { | |||||
40 | th is.modules = modules ; | |||||
41 | } | |||||
42 | ||||||
43 | ||||||
44 | @Suppr essWarning s("uncheck ed") // JA SPIC API u ses raw ty pes | |||||
45 | @Overr ide | |||||
46 | public AuthStatu s validate Request(Me ssageInfo messageInf o, Subject clientSub ject, | |||||
47 | Subject serviceSub ject) thro ws AuthExc eption { | |||||
48 | fo r (int mod uleIndex = 0; module Index < mo dules.size (); module Index++) { | |||||
49 | ServerAu thModule m odule = mo dules.get( moduleInde x); | |||||
50 | AuthStat us result = module.v alidateReq uest(messa geInfo, cl ientSubjec t, service Subject); | |||||
51 | if (resu lt != Auth Status.SEN D_FAILURE) { | |||||
52 | mess ageInfo.ge tMap().put ("moduleIn dex", Inte ger.valueO f(moduleIn dex)); | |||||
53 | retu rn result; | |||||
54 | } | |||||
55 | } | |||||
56 | re turn AuthS tatus.SEND _FAILURE; | |||||
57 | } | |||||
58 | ||||||
59 | ||||||
60 | @Overr ide | |||||
61 | public AuthStatu s secureRe sponse(Mes sageInfo m essageInfo , Subject serviceSub ject) | |||||
62 | throws A uthExcepti on { | |||||
63 | Se rverAuthMo dule modul e = module s.get(((In teger) mes sageInfo.g etMap().ge t("moduleI ndex")).in tValue()); | |||||
64 | re turn modul e.secureRe sponse(mes sageInfo, serviceSub ject); | |||||
65 | } | |||||
66 | ||||||
67 | ||||||
68 | @Overr ide | |||||
69 | public void clea nSubject(M essageInfo messageIn fo, Subjec t subject) throws Au thExceptio n { | |||||
70 | fo r (ServerA uthModule module : m odules) { | |||||
71 | module.c leanSubjec t(messageI nfo, subje ct); | |||||
72 | } | |||||
73 | } | |||||
74 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2017 Araxis Ltd (www.araxis.com). All rights reserved.