Produced by Araxis Merge on 7/10/2017 1:01:46 PM Central Daylight 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 | C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\TomcatAdapter\main\src\java\gov\va\med\server\tomcat | TomcatBasicSkipVistaAuthenticationValve.java | Thu Jun 29 17:22:52 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\TomcatAdapter\main\src\java\gov\va\med\server\tomcat | TomcatBasicSkipVistaAuthenticationValve.java | Thu Jul 6 15:05:16 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 180 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| 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 | * | |
| 3 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: May 19, 2011 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.s erver.tomc at; | |
| 27 | ||
| 28 | import gov .va.med.im aging.tomc at.vistare alm.RealmE rrorContex t; | |
| 29 | ||
| 30 | import jav a.io.IOExc eption; | |
| 31 | ||
| 32 | import org .apache.ca talina.con nector.Req uest; | |
| 33 | import org .apache.ca talina.con nector.Res ponse; | |
| 34 | //import o rg.apache. catalina.d eploy.Logi nConfig; | |
| 35 | import org .apache.to mcat.util. descriptor .web.Login Config; | |
| 36 | ||
| 37 | import org .apache.lo g4j.Logger ; | |
| 38 | ||
| 39 | ||
| 40 | /** | |
| 41 | * This ex tends the Basic auth entication valve for Tomcat an d checks f or values on thread local to a dd as resp onse heade rs. | |
| 42 | * This al lows a cli ent to kno w why an a uthenticat ion failed | |
| 43 | * | |
| 44 | * @author vhaiswpet erb | |
| 45 | * | |
| 46 | */ | |
| 47 | public cla ss TomcatB asicSkipVi staAuthent icationVal ve | |
| 48 | extends or g.apache.c atalina.au thenticato r.BasicAut henticator | |
| 49 | { | |
| 50 | pr ivate fina l static L ogger logg er = Logge r.getLogge r(TomcatBa sicSkipVis taAuthenti cationValv e.class); | |
| 51 | pu blic final static St ring httpH eaderAuthe nticateErr orMessage = "xxx-aut henticate- error-mess age"; | |
| 52 | pu blic final static St ring httpH eaderAuthe nticateErr orName = " xxx-authen ticate-err or-name"; | |
| 53 | pu blic final static St ring httpH eaderAuthe nticationS kipVistaAu thenticati on = "xxx- skip-authe nticate"; | |
| 54 | pr ivate fina l String s kipValue = "true"; | |
| 55 | ||
| 56 | ||
| 57 | ||
| 58 | pu blic Tomca tBasicSkip VistaAuthe nticationV alve() | |
| 59 | { | |
| 60 | supe r(); | |
| 61 | logg er.info("T omcatBasic SkipVistaA uthenticat ionValve < ctor>"); | |
| 62 | } | |
| 63 | ||
| 64 | // @Override | |
| 65 | pu blic boole an authent icate(Requ est reques t, Respons e response , LoginCon fig loginC onfig) | |
| 66 | throws IOExcepti on | |
| 67 | { | |
| 68 | // m ust clear before cal ling to en sure not u sing a pre vious atte mpts data (since thr eads are r ecycled) | |
| 69 | Real mErrorCont ext.clear( ); | |
| 70 | Real mErrorCont ext.setSki pVistaAuth entication (skipValue ); | |
| 71 | logg er.debug(" TomcatBasi cSkipVista Authentica tionValve. authentica te(Request , Response , LoginCon fig)"); | |
| 72 | logg er.debug(" LoginConfi g: " + log inConfig.t oString()) ; | |
| 73 | //bo olean resu lt = super .authentic ate(reques t, respons e, loginCo nfig); | |
| 74 | bool ean result = super.a uthenticat e(request, response) ; | |
| 75 | if(! result) | |
| 76 | { | |
| 77 | String errorMess age = Real mErrorCont ext.getPro perty(Real mErrorCont ext.realmE rrorContex tException Message); | |
| 78 | String exception Class = Re almErrorCo ntext.getP roperty(Re almErrorCo ntext.real mErrorCont extExcepti onName); | |
| 79 | logger .debug("au thenticati on failed with error '" + (exc eptionClas s == null ? "<null>" : excepti onClass) + "' and me ssage '" + (errorMes sage == nu ll ? "<nul l>" : erro rMessage) + "'."); | |
| 80 | if(err orMessage != null) | |
| 81 | response .addHeader (httpHeade rAuthentic ateErrorMe ssage, err orMessage) ; | |
| 82 | if(exc eptionClas s != null) | |
| 83 | response .addHeader (httpHeade rAuthentic ateErrorNa me, except ionClass); | |
| 84 | } | |
| 85 | Real mErrorCont ext.unsetR ealmErrorC ontext(); | |
| 86 | retu rn result; | |
| 87 | ||
| 88 | //re turn true; | |
| 89 | } | |
| 90 | ||
| 91 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.