8. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/2/2019 1:06:53 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.

8.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\configuration\security OAuth2AuthorizationServerConfig.java Wed Mar 27 19:22:44 2019 UTC
2 C:\AraxisMergeCompare\Pri_re\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\configuration\security OAuth2AuthorizationServerConfig.java Thu Mar 28 17:50:38 2019 UTC

8.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 146
Changed 1 2
Inserted 0 0
Removed 0 0

8.3 Comparison options

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

8.4 Active regular expressions

No regular expressions were active.

8.5 Comparison detail

  1   package go v.va.med.a rs.configu ration.sec urity;
  2  
  3  
  4   import org .springfra mework.bea ns.factory .annotatio n.Autowire d;
  5   import org .springfra mework.bea ns.factory .annotatio n.Qualifie r;
  6   import org .springfra mework.con text.annot ation.Bean ;
  7   import org .springfra mework.con text.annot ation.Conf iguration;
  8   import org .springfra mework.cor e.env.Envi ronment;
  9   import org .springfra mework.cor e.io.Class PathResour ce;
  10   import org .springfra mework.sec urity.auth entication .Authentic ationManag er;
  11   import org .springfra mework.sec urity.oaut h2.config. annotation .configure rs.ClientD etailsServ iceConfigu rer;
  12   import org .springfra mework.sec urity.oaut h2.config. annotation .web.confi guration.A uthorizati onServerCo nfigurerAd apter;
  13   import org .springfra mework.sec urity.oaut h2.config. annotation .web.confi guration.E nableAutho rizationSe rver;
  14   import org .springfra mework.sec urity.oaut h2.config. annotation .web.confi gurers.Aut horization ServerEndp ointsConfi gurer;
  15   import org .springfra mework.sec urity.oaut h2.provide r.token.To kenStore;
  16   import org .springfra mework.sec urity.oaut h2.provide r.token.st ore.JwtAcc essTokenCo nverter;
  17   import org .springfra mework.sec urity.oaut h2.provide r.token.st ore.JwtTok enStore;
  18   import org .springfra mework.sec urity.oaut h2.provide r.token.st ore.KeySto reKeyFacto ry;
  19  
  20   /**
  21    * 
  22    * @author  
D NS     GANGAV
  23    *
  24    */
  25   @Configura tion
  26   @EnableAut horization Server
  27   public cla ss OAuth2A uthorizati onServerCo nfig exten ds Authori zationServ erConfigur erAdapter  {
  28           
  29           @A utowired
  30           @Q ualifier(" authentica tionManage rBean")
  31           pr ivate Auth entication Manager au thenticati onManager;
  32           
  33           @A utowired
  34           En vironment  env;
  35           
  36           @B ean
  37           pu blic Token Store toke nStore() {
  38                    retu rn new Jwt TokenStore (jwtTokenE nhancer()) ;
  39           }
  40           
  41           @O verride
  42           pu blic void  configure(  ClientDet ailsServic eConfigure r clients)  throws Ex ception {
  43                    clie nts.inMemo ry()
  44                             .withC lient(env. getPropert y("oauth2. authorizat ion.client .clientnam e"))
  45                             .autho rizedGrant Types(env. getPropert y("oauth2. authorizat ion.client .grantType .password" ),env.getP roperty("o auth2.auth orization. client.gra ntType.aut horization Code"),env .getProper ty("oauth2 .authoriza tion.clien t.grantTyp e.refreshT oken"),env .getProper ty("oauth2 .authoriza tion.clien t.grantTyp e.implicit "))
  46                             .autho rities(env .getProper ty("oauth2 .authoriza tion.clien t.authorit ies.roleCl ient"),env .getProper ty("oauth2 .authoriza tion.clien t.authorit ies.roleTr ustedClien t"))
  47                             .scope s(env.getP roperty("o auth2.auth orization. client.sco pe.read"), env.getPro perty("oau th2.author ization.cl ient.scope .write"),e nv.getProp erty("oaut h2.authori zation.cli ent.scope. trust"))
  48                             .secre t(env.getP roperty("o auth2.auth orization. client.sec ret"))
  49                             .acces sTokenVali ditySecond s(Integer. parseInt(e nv.getProp erty("oaut h2.authori zation.cli ent.access TokenValid itySecond" )))
  50                             .refre shTokenVal iditySecon ds(Integer .parseInt( env.getPro perty("oau th2.author ization.cl ient.refre shTokenVal iditySecon d")))
  51                             .and()
  52                             .withC lient(env. getPropert y("oauth2. authorizat ion.client .clientnam e2"))
  53                             .autho rizedGrant Types(env. getPropert y("oauth2. authorizat ion.client .grantType .password2 "),env.get Property(" oauth2.aut horization .client.gr antType.au thorizatio nCode2"),e nv.getProp erty("oaut h2.authori zation.cli ent.grantT ype.refres hToken2"), env.getPro perty("oau th2.author ization.cl ient.grant Type.impli cit2"))
  54                             .autho rities(env .getProper ty("oauth2 .authoriza tion.clien t.authorit ies.roleCl ient2"),en v.getPrope rty("oauth 2.authoriz ation.clie nt.authori ties.roleT rustedClie nt2"))
  55                             .scope s(env.getP roperty("o auth2.auth orization. client.sco pe.read2") ,env.getPr operty("oa uth2.autho rization.c lient.scop e.write2") ,env.getPr operty("oa uth2.autho rization.c lient.scop e.trust2") )
  56                             .secre t(env.getP roperty("o auth2.auth orization. client.sec ret2"))
  57                             .acces sTokenVali ditySecond s(Integer. parseInt(e nv.getProp erty("oaut h2.authori zation.cli ent.access TokenValid itySecond2 ")))
  58                             .refre shTokenVal iditySecon ds(Integer .parseInt( env.getPro perty("oau th2.author ization.cl ient.refre shTokenVal iditySecon d2")));
  59           }
  60           
  61           @O verride
  62           pu blic void  configure( Authorizat ionServerE ndpointsCo nfigurer e ndpoints)  throws Exc eption {
  63                    endp oints.toke nStore(tok enStore())
  64                    .tok enEnhancer (jwtTokenE nhancer()) .authentic ationManag er(authent icationMan ager);
  65           }
  66  
  67           pu blic JwtAc cessTokenC onverter j wtTokenEnh ancer() {
  68                    KeyS toreKeyFac tory keySt oreFactory  = new Key StoreKeyFa ctory(new  ClassPathR esource("A RS_JWT.jks "),"VACCSE ".toCharAr ray());
  69                    JwtA ccessToken Converter  converter  = new JwtA ccessToken Converter( );
  70                    conv erter.setK eyPair(key StoreFacto ry.getKeyP air(env.ge tProperty( "oauth2.au thorizatio n.jwt.keyp air")));
  71                    retu rn convert er;
  72           }
  73           
  74   }