Produced by Araxis Merge on 12/5/2017 12:06:50 PM Central 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaDataSource\main\src\java\gov\va\med\imaging\vistadatasource | VistaUserAuthenticationDataSourceProvider.java | Mon Dec 4 21:34:36 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaDataSource\main\src\java\gov\va\med\imaging\vistadatasource | VistaUserAuthenticationDataSourceProvider.java | Mon Dec 4 22:06:30 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 310 |
| Changed | 2 | 4 |
| 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: Feb 20, 2012 | |
| 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.i maging.vis tadatasour ce; | |
| 27 | ||
| 28 | import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce; | |
| 29 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 30 | import gov .va.med.im aging.core .interface s.exceptio ns.Credent ialsExpire dException ; | |
| 31 | import gov .va.med.im aging.core .interface s.exceptio ns.Invalid UserCreden tialsExcep tion; | |
| 32 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 33 | import gov .va.med.im aging.data source.Use rAuthentic ationSpi; | |
| 34 | import gov .va.med.im aging.data source.exc eptions.In validCrede ntialsExce ption; | |
| 35 | import gov .va.med.im aging.exch ange.busin ess.Resolv edSite; | |
| 36 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
| 37 | import gov .va.med.im aging.exch ange.enums .ImagingSe curityCont extType; | |
| 38 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext; | |
| 39 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 40 | import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities; | |
| 41 | import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on; | |
| 42 | ||
| 43 | import jav a.io.IOExc eption; | |
| 44 | ||
| 45 | import org .apache.lo gging.log4 j.LogManag er; | |
| 46 | import org .apache.lo gging.log4 j.Logger; | |
| 47 | ||
| 48 | /** | |
| 49 | * @author
|
|
| 50 | * | |
| 51 | */ | |
| 52 | public cla ss VistaUs erAuthenti cationData SourceProv ider | |
| 53 | extends Vi staUserAut horization DataSource Provider | |
| 54 | implements UserAuthe nticationS pi | |
| 55 | { | |
| 56 | ||
| 57 | pr ivate Logg er logger = LogManag er.getLogg er(VistaUs erAuthenti cationData SourceProv ider.class ); | |
| 58 | ||
| 59 | pu blic final static St ring SUPPO RTED_PROTO COL = "vis ta"; | |
| 60 | ||
| 61 | /** | |
| 62 | * @param re solvedArti factSource | |
| 63 | * @param pr otocol | |
| 64 | * / | |
| 65 | pu blic Vista UserAuthen ticationDa taSourcePr ovider(Res olvedArtif actSource resolvedAr tifactSour ce, String protocol) | |
| 66 | { | |
| 67 | supe r(resolved ArtifactSo urce, prot ocol); | |
| 68 | if(! (resolved ArtifactSo urce insta nceof Reso lvedSite) ) | |
| 69 | throw new Unsupp ortedOpera tionExcept ion("The a rtifact so urce must be an inst ance of Re solvedSite and it is a '" + re solvedArti factSource .getClass( ).getSimpl eName() + "'."); | |
| 70 | } | |
| 71 | ||
| 72 | /* * | |
| 73 | * The artif act source must be c hecked in the constr uctor to a ssure that it is an instance | |
| 74 | * of Resolv edSite. | |
| 75 | * | |
| 76 | * @return | |
| 77 | * / | |
| 78 | pr ivate Reso lvedSite g etResolved Site() | |
| 79 | { | |
| 80 | retu rn (Resolv edSite)get ResolvedAr tifactSour ce(); | |
| 81 | } | |
| 82 | ||
| 83 | pr ivate Site getSite() | |
| 84 | { | |
| 85 | retu rn getReso lvedSite() .getSite() ; | |
| 86 | } | |
| 87 | ||
| 88 | /* (non-Java doc) | |
| 89 | * @see gov. va.med.ima ging.datas ource.User Authentica tionDataSo urce#isVer sionCompat ible() | |
| 90 | * / | |
| 91 | @O verride | |
| 92 | pu blic boole an isVersi onCompatib le() | |
| 93 | { | |
| 94 | retu rn true; | |
| 95 | } | |
| 96 | ||
| 97 | /* (non-Java doc) | |
| 98 | * @see gov. va.med.ima ging.datas ource.User Authentica tionSpi#au thenticate User(java. lang.Strin g, java.la ng.String) | |
| 99 | * / | |
| 100 | @O verride | |
| 101 | pu blic void authentica teUser() | |
| 102 | th rows Metho dException , Connecti onExceptio n | |
| 103 | { | |
| 104 | Vist aCommonUti lities.set DataSource MethodAndV ersion("au thenticate User", get DataSource Version()) ; | |
| 105 | logg er.info("a uthenticat eUser Tran sactionCon text (" + Transactio nContextFa ctory.get( ).getTrans actionId() + ")."); | |
| 106 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
| 107 | Stri ng imaging SecurityCo ntextType = transact ionContext .getImagin gSecurityC ontextType (); | |
| 108 | try | |
| 109 | { | |
| 110 | // JMW 7/25/2012 P124 - if there is no securit y context then use t he CAPRI c ontext. Th is is nece ssary for Patch 124 so that it doesn't | |
| 111 | // try to use MA G WINDOWS which for CAPRI/VBA users will not work against th e claims s ystem (sit e 100). | |
| 112 | if(ima gingSecuri tyContextT ype == nul l || imagi ngSecurity ContextTyp e.length() <= 0) | |
| 113 | transact ionContext .setImagin gSecurityC ontextType (ImagingSe curityCont extType.DV BA_CAPRI_G UI.toStrin g()); | |
| 114 | VistaS ession.aut henticateU ser(getMet adataUrl() , getSite( )); | |
| 115 | ||
| 116 | ||
| 117 | String applicati onName = t ransaction Context.ge tBrokerSec urityAppli cationName (); | |
| 118 | if(app licationNa me == null || applic ationName. length() < = 0) | |
| 119 | { | |
| 120 | logger.w arn("No ap plication name speci fied, cann ot generat e BSE toke n"); | |
| 121 | } | |
| 122 | else | |
| 123 | { | |
| 124 | String b seToken = | |
| 125 | getUserTok en(transac tionContex t.getBroke rSecurityA pplication Name()); | |
| 126 | transact ionContext .setBroker SecurityTo ken(bseTok en); | |
| 127 | } | |
| 128 | } | |
| 129 | catc h(InvalidC redentials Exception icX) | |
| 130 | { | |
| 131 | // con vert from a Connecti onExceptio n base to a MethodEx ception (s o that it is fatal a nd no othe r path is attempted) | |
| 132 | // klu dgey way t o get prop er excepti on thrown so it is a vailable t o users | |
| 133 | if(icX .getMessag e() != nul l && icX.g etMessage( ).contains ("Expired Verify Cod e")) | |
| 134 | { | |
| 135 | throw ne w Credenti alsExpired Exception( icX.getMes sage(), ic X); | |
| 136 | } | |
| 137 | else | |
| 138 | { | |
| 139 | throw ne w InvalidU serCredent ialsExcept ion(icX.ge tMessage() , icX); | |
| 140 | } | |
| 141 | } | |
| 142 | catc h(IOExcept ion ioX) | |
| 143 | { | |
| 144 | throw new Connec tionExcept ion(ioX); | |
| 145 | } | |
| 146 | fina lly | |
| 147 | { | |
| 148 | transa ctionConte xt.setImag ingSecurit yContextTy pe(imaging SecurityCo ntextType) ; | |
| 149 | } | |
| 150 | } | |
| 151 | ||
| 152 | pr otected St ring getDa taSourceVe rsion() | |
| 153 | { | |
| 154 | retu rn "1"; | |
| 155 | } | |
| 156 | ||
| 157 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.