Produced by Araxis Merge on 9/15/2018 10:48:16 PM Eastern 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 | MHV_2018.4.0.0.zip\2018.4.0.0\national portal\mhv_source\mhv_liferay\mhv_hooks\mhv-liferay-registration-autologin-hook\src\main\java\gov\va\med\mhv\liferay\autologin\api\security | HttpSessionScreenNameClientRequestFilter.java | Thu Aug 23 21:34:10 2018 UTC |
| 2 | MHV_2018.4.0.0.zip\2018.4.0.0\national portal\mhv_source\mhv_liferay\mhv_hooks\mhv-liferay-registration-autologin-hook\src\main\java\gov\va\med\mhv\liferay\autologin\api\security | HttpSessionScreenNameClientRequestFilter.java | Sat Sep 15 21:58:27 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 120 |
| 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 | */ | |
| 4 | package go v.va.med.m hv.liferay .autologin .api.secur ity; | |
| 5 | ||
| 6 | import jav a.io.IOExc eption; | |
| 7 | ||
| 8 | import jav ax.servlet .http.Http Session; | |
| 9 | import jav ax.ws.rs.c lient.Clie ntRequestC ontext; | |
| 10 | import jav ax.ws.rs.c lient.Clie ntRequestF ilter; | |
| 11 | ||
| 12 | import com .liferay.p ortal.kern el.log.Log ; | |
| 13 | import com .liferay.p ortal.kern el.log.Log FactoryUti l; | |
| 14 | import com .liferay.p ortal.kern el.servlet .PortalSes sionThread Local; | |
| 15 | ||
| 16 | import gov .va.med.mh v.liferay. autologin. PostRegist rationAuto Login; | |
| 17 | ||
| 18 | /** | |
| 19 | * @author DNS | |
| 20 | * | |
| 21 | */ | |
| 22 | public cla ss HttpSes sionScreen NameClient RequestFil ter implem ents Clien tRequestFi lter { | |
| 23 | ||
| 24 | pr ivate stat ic final L og logger = LogFacto ryUtil.get Log(HttpSe ssionScree nNameClien tRequestFi lter.class ); | |
| 25 | ||
| 26 | pr ivate stat ic final S tring API_ APP_KEY = "appToken" ; | |
| 27 | pr ivate stat ic final S tring API_ MHV_USERNA ME_KEY = " mhvUsernam e"; | |
| 28 | pr ivate stat ic final S tring SESS ION_USERNA ME_KEY = " LIFERAY_SH ARED_useri d"; | |
| 29 | pr ivate stat ic final S tring APP_ TOKEN = "M yHealth3Ve t123"; | |
| 30 | ||
| 31 | /* | |
| 32 | * (non-Java doc) | |
| 33 | * | |
| 34 | * @see java x.ws.rs.cl ient.Clien tRequestFi lter#filte r(javax.ws .rs.client . | |
| 35 | * ClientReq uestContex t) | |
| 36 | * / | |
| 37 | @O verride | |
| 38 | pu blic void filter(Cli entRequest Context re questConte xt) throws IOExcepti on { | |
| 39 | try { | |
| 40 | HttpSe ssion sess ion = Port alSessionT hreadLocal .getHttpSe ssion(); | |
| 41 | String mhvUserna me = (Stri ng) sessio n.getAttri bute(PostR egistratio nAutoLogin .ATTR_SCRE EN_NAME); | |
| 42 | ||
| 43 | if (mh vUsername == null) { | |
| 44 | logger.i nfo("PostR egistratio nAutoLogin : Unable t o get mhvC orrelation Id or mhvU sername fr om session ."); | |
| 45 | throw ne w IOExcept ion("Unabl e to get m hvCorrelat ionId or m hvUsername from sess ion"); | |
| 46 | } | |
| 47 | ||
| 48 | if (mh vUsername != null) { | |
| 49 | logger.i nfo("PostR egistratio nAutoLogin : Adding ' " + API_AP P_KEY + "' and '" + API_MHV_US ERNAME_KEY + "' to A PI Client Request fo r " | |
| 50 | + API_MHV_US ERNAME_KEY + " " + m hvUsername ); | |
| 51 | } | |
| 52 | ||
| 53 | reques tContext.g etHeaders( ).add(API_ APP_KEY, A PP_TOKEN); | |
| 54 | reques tContext.g etHeaders( ).add(API_ MHV_USERNA ME_KEY, mh vUsername) ; | |
| 55 | } ca tch (Excep tion e) { | |
| 56 | logger .info("Pos tRegistrat ionAutoLog in: Unable to access client ht tp session ."); | |
| 57 | e.prin tStackTrac e(); | |
| 58 | throw new IOExce ption("Una ble to acc ess client http sess ion", e); | |
| 59 | } | |
| 60 | } | |
| 61 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.