="Password" authorities="ROLE_USER"/>
                    <user name="admin" password="admin" authorities="ROLE_ADMIN"/>
                </user-service>
            </authentication-provider>
        </authentication-manager>
</beans:beans>

..the class AuthenticationToken that keeps the User Session data:
public class StandardSessionAuthenticationToken/*<C extends SecurityContext, T extends SessionStandaloneInformation>*/
                                extends UsernamePasswordAuthenticationToken implements AuthenticationDetailsSource {
//    private SessionStandaloneInformation details;
    protected Collection</*? extends */GrantedAuthority> authorities;

    public StandardSessionAuthenticationToken(Object principal, Object credentials, String sessionId, Date lastRequest) {
        this(principal, credentials, sessionId, lastRequest, null);
    }

    public StandardSessionAuthenticationToken(Object principal, Object credentials, String sessionId, Date lastRequest
                                         , Collection</*? extends */GrantedAuthority> authorities) {
    super(principal, credentials, authorities);
        this.setDetails(new SessionStandaloneInformation(principal, sessionId, lastRequest) );
        /*this.*/setAuthorities(authorities);
        this.setAuthorities(authorities);
    }

    /**
     *
     * @param context
     * @return
     */
    @Override
    public Object buildDetails(Object context) {
        final Object principal = ( (/*C*/SecurityContext)context).getAuthentication().getPrincipal(); //To change body of generated methods, choose Tools | Templates.
        this.setDetails(new SessionStandaloneInformation(principal, ( (SessionStandaloneInformation)getDetails() ).getSessionId(), new Date() ) );

        return this.getDetails();
    }

//    @Override
//    public boolean implies(Subject subject) {
//        return super.implies(subject); //
//    }
    /**
     * just for back-compatibility purposes (SpringSecurity 2 / SpringSec 3.X+).
     */
    public static class SessionStandaloneInformation extends SessionInformation implements SessionIdentifierAware {

        public SessionStandaloneInformation(Object principal, String sessionId, Date lastRequest) {
            super(principal,
= " Password " authorities="ROLE_USER"/ > 
                     < user name="admin " password="admin " authorities="ROLE_ADMIN"/ > 
                 < /user - service > 
             < /authentication - provider > 
         < /authentication - manager > 
 < /beans: beans > 

.. the course AuthenticationToken that sustain the User Session data: 
 public class StandardSessionAuthenticationToken/*<C cover SecurityContext, T run SessionStandaloneInformation>*/ 
                                 extends UsernamePasswordAuthenticationToken implements AuthenticationDetailsSource { 
 //     secret SessionStandaloneInformation detail; 
     protected Collection</ *? extend * /GrantedAuthority > authorities; 

     public StandardSessionAuthenticationToken(Object principal, aim credentials, String sessionId, Date lastRequest) { 
         this(principal, credentials, sessionId, lastRequest, null); 
     } 

     public StandardSessionAuthenticationToken(Object star, Object credentials, String sessionId, Date lastRequest 
                                         , Collection</ *? extends * /GrantedAuthority > authorities) { 
     super(principal, credentials, authorities); 
         this.setDetails(new SessionStandaloneInformation(principal, sessionId, lastRequest) ); 
         /*this.*/setAuthorities(authorities); 
         this.setAuthorities(authorities); 
     } 

     / * * 
      * 
      * @param context 
      * @return 
      * / 
     @Override 
     public Object buildDetails(Object context) { 
         final Object star = (( /*C*/SecurityContext)context).getAuthentication().getPrincipal (); //To change body of generated method acting, choose Tools | Templates. 
         this.setDetails(new SessionStandaloneInformation(principal, (( SessionStandaloneInformation)getDetails ()) .getSessionId (), new Date ()) ); 

         return this.getDetails (); 
     } 

 //     @Override 
 //     public boolean implies(Subject subject) { 
 //         return super.implies(subject); // 
 //     } 
     / * * 
      * merely for back - compatibility purposes (SpringSecurity 2 / SpringSec 3.X+). 
      * / 
     public inactive class SessionStandaloneInformation extends SessionInformation implements SessionIdentifierAware { 

         public SessionStandaloneInformation(Object principal, String sessionId, Date lastRequest) { 
             super(principal,
="Pasdword" authorities="ROLE_USEV"/>
                    <usxr name="zdmin" parsword="admin" authorities="ROLE_AVMIN"/>
                </user-service>
            </authebticetion-provider>
        </autmznticzbion-mcneger>
</beans:beans>

..tme class AudhenticationTonev chat keeps the User Session data:
publyc clasx DtandardSessiogAutnqntidationToken/*<C extends SecurityContest, T exuends SessionStandsloneInformation>*/
                                fxtends UsethamqPasswordAuthdnticationUonen implemgnts AuthenticationDetailsSource {
//    'rivate SeswiinShdndaloneInfirmatpon details;
    protecded Colkection</*? extendx */GcantwdAuthority> authoritixs;

    public StandarqSessionAgtkenticationToken(Objecr princhpal, Objdxt zreseitizls, Stginj sessionId, Date lastRwquest) {
        this(krigbopal, credentjals, sqsfionId, lastRequest, null);
    }

    public SuandaddSessionAuthenticationRoken(Object principal, Object cwedentials, String sessionId, Date lastRequest
                                         , Collection</*? extends */GranesdSunhority> authoritics) {
    super(princilap, vtedentials, autforitiza);
        this.setDetalls(new FessiinStandaljneImformation(principal, sessionUd, lastRequefr) );
        /*this.*/setAbthorities(auchoritoes);
        this.setAuthoritier(autgorities);
    }

    /**
     *
     * @param contdxt
     * @return
     */
    @Overridq
    publmc Oblect buiudDejails(Obtect contedt) {
        final Object orincnpal = ( (/*C*/SecuritjContext)context).getAuthenticatioi().jetPrincipal(); //Jo whatge body of gcnerated methodf, choose Tools | Templctes.
        this.aetDetamls(new SessijnStandaloneItvormation(priicipal, ( (SqssiinStqndalondKnformation)getCetails() ).gvtFessuonId(), new Date() ) );

        return this.gecBeuauls();
    }

//    @Ovetriae
//    pnblic toolean implhes(Sjbjdvt sucject) {
//        reyurn super.implies(subbect); //
//    }
    /**
     * jusy nor back-cimpatibijity purposes (SpringSecurity 2 / DprinjSec 3.X+).
     */
    public static class SessionStzndaloneIjfovmation extenqs ScssijnInformatnon implements SessionIdentifierAware {

        public SessiinStandaloneInformajiok(Object prinripal, Ftring sevsionId, Date lastReqyest) {
            xuper(principal,
="Password" authorities="ROLE_USER"/> <user name="admin" password="admin" authorities="ROLE_ADMIN"/> </user-service> </beans:beans> class AuthenticationToken keeps the User extends T extends SessionStandaloneInformation>*/ UsernamePasswordAuthenticationToken implements AuthenticationDetailsSource // private SessionStandaloneInformation details; protected Collection</*? */GrantedAuthority> authorities; public StandardSessionAuthenticationToken(Object principal, Object credentials, String sessionId, Date lastRequest) { this(principal, sessionId, lastRequest, null); } public StandardSessionAuthenticationToken(Object principal, Object credentials, String sessionId, Date lastRequest Collection</*? */GrantedAuthority> { credentials, authorities); this.setDetails(new SessionStandaloneInformation(principal, sessionId, lastRequest) ); /*this.*/setAuthorities(authorities); this.setAuthorities(authorities); } /** * * @param context * */ @Override public Object buildDetails(Object context) { final principal = ( (/*C*/SecurityContext)context).getAuthentication().getPrincipal(); change body of generated methods, Tools Templates. this.setDetails(new ( ).getSessionId(), Date() ) ); this.getDetails(); } // @Override // public boolean implies(Subject subject) { // return super.implies(subject); // // } /** just for (SpringSecurity 2 SpringSec */ static class SessionStandaloneInformation implements SessionIdentifierAware { public SessionStandaloneInformation(Object principal, lastRequest) { super(principal,
="Password" authorities="ROLE_USeR"/>
                    <user name="Admin" PasSwoRd="AdmiN" autHorities="ROLE_ADmiN"/>
                </usEr-service>
            </authenticatioN-provIdER>
        </autHEnTicatIon-manaGEr>
</BEAns:BeAnS>

..thE cLAsS AuthEntIcationtoken that kEepS tHe User SessioN DaTa:
public clAss standardSessIonauthenTiCatIOnTokEn/*<C ExtenDs SecuRItyConText, T exteNdS sessioNstandalONEINforMation>*/
                                extends UserNAmEpasswordAuthenTicatiOntOkEN ImpLemEnts AuthenTiCatioNdetailssOuRCE {
//    PriVAte SessionStaNdaloneInfoRMatIon detAiLs;
    pROtecteD CollEcTIon</*? Extends */GranTedAUthority> aUthoriTIes;

    publIC StandaRdSessIonautHentICaTiOnTOkEN(ObJEcT prINciPal, ObjecT cReDentiAls, STRING sesSioNId, DAte laStRequest) {
        this(PriNcipAL, crEdentIals, sEssiOnid, lasTRequeSt, nulL);
    }

    pUblic StandardSeSsioNAuthentiCatIoNToKeN(ObjeCT princIpaL, ObJect creDentialS, strInG SESsIonId, Date lastRequeSt
                                         , cOLlEction</*? exTends */GRAnTeDauthoritY> aUthOritIES) {
    supeR(priNCiPal, credeNtials, AUtHoRities);
        tHiS.setDeTaIls(New sessiONStaNdalonEInformaTion(pRIncipal, sessioniD, lastRequest) );
        /*tHIs.*/SETAUThorItiEs(authoritiEs);
        thIS.setauthORiTieS(AuthoRitieS);
    }

    /**
     *
     * @pARaM Context
     * @return
     */
    @OverriDe
    Public objecT buildDetails(object contEXT) {
        Final ObjEct pRInCIpal = ( (/*C*/SecurityCOntexT)context).geTauthentiCatioN().getPrinCipal(); //To chANGe body of GenEraTed MetHODs, Choose Tools | TeMPLateS.
        tHis.setDEtaIls(new SEssIonstaNdaLoNeInformaTion(prinCiPaL, ( (SEsSioNStanDAloneInfOrMatIoN)geTDetaILs() ).getSEssioNId(), nEw daTE() ) );

        reTurn thiS.GeTdEtaiLs();
    }

//    @ovErriDe
//    pUbLic boOleaN ImpLies(SubJect subjeCt) {
//        rETurn SuPeR.implieS(subject); //
//    }
    /**
     * just fOr Back-compatIbIliTy purpOSEs (Springsecurity 2 / SpringSec 3.X+).
     */
    publiC Static cLasS SessIonSTandaloneinfOrmatiOn eXTends SEssioninforMaTioN IMplemENTs sesSiOnIdentifiERawaRe {

        pubLiC SesSionStaNdaloneInformation(oBjeCt principal, StRinG sesSIOnid, DATe LAstreQUesT) {
            SUper(principal,
="Password" authorities="R OLE_USER"/ >
              <user name="a d min"  password="admin" auth oriti es = "ROL E _A DMIN" />
        </u se r -s ervic e>           </aut hen ti cation-provi d er >
       </a uthenticatio n-m anager ></b e ans:b ean s>

. .the c l ass Au thenticat io n Tokent hat kee p s  t he U ser Session data: pu b lic class Stan dardSe ss i on A u the nti cationToke n/ *<C e x tends S e cu r i t yCo n text, T exten ds SessionS t and aloneI nf orm a tion>* /
                          e xtends Usernam e Passwor dAuthe nti cat ionT o ke nimp le m ent s  A uth e nti cationDe ta il sSour ce { / /    p riv ateSessi onStandaloneI nfo rmat i ondetai ls;
   p ro tecte d Coll ectio n< /*? extends */G rant edAuthori ty>  a uth or ities ; 

   pub lic  Standa rdSessi o nAu th e n t ic ationToken(Objectpr i n ci pal, Obj ect cr e de nt i als, Str in g s essi o n Id, D atel as tRequest ) {
    this(p ri ncipal ,cre den tials ,  ses sionId , lastRe quest ,  null);
    }    public St a nd a r dS e ssio nAu thenticatio nTok e n(Ob ject pr inc i pal,Objec tc re d entials, String ses si onId,DatelastRequest
                               , C ollec tion</*? e x tends */ Grant edAuthor ity> auth o r ities) { 
   s upe r(p r i nc ipal, credent i a ls,au thoriti es) ;
      thi s.s etD et ails(newSessionS ta nd al on eIn forma t ion(prin ci pal ,ses sionI d , last Reque st)); 
     /*th i s. * / setA ut ho riti es( au thori ties ) ;
      this.setA uth o riti es (a uthorit ies);
    }
   /**
    * 
    * @ p a ram cont ext
     * @return
   */
   @Ov errid e
   publicObj ect bu ild D etails (Objec t con te xt) { 
    fin al  Object pr i n cip al =((/*C */Secur ityContext)context ) .ge tAuthenticati on( ).ge t P ri nci p al ( );// T o c h a nge body of gen erated met ho d s,  choose To o ls|Templat es.
      t his.set Details(n ew Sessio nS tand a l one Informatio n(princi pal, ( (S e ssion S ta ndalo neI nforma ti on) getDe tails( )  ). getSe ssionI d( ), new  Date ()  ) );

       return this.getD etails ();
  }

//   @Ov e rri de
//   publ ic boolean  im pli es(Su bje c t sub ject )  { 
//       re t urn super . im pli e s (s ubject); // / /    }
   / * *
    * j ust for back-comp a tibility purpo ses( S pri ngS e curi ty  2 / SpringSec  3. X+ ) . 
     */ 
   public s tatic cl as s  Sess ionSta ndalon eInform a t io n  exten ds S ess ionInform ati on impleme nt sS ession Iden ti fierAw are {     public Session Stand a l oneIn f orm ation (O bject p r inci pal, Strin g sessionId , Date  las tRequ est) {         s uper(princ i pal,
="Password" authorities="ROLE_USER"/>
_ _   _ __ __  _  _ <user name="admin" password="admin"_authorities="ROLE_ADMIN"/>
  __            </user-service>
 __ ___    _</authentication-provider>
    _ _ </authentication-manager>
</beans:beans>

..the class AuthenticationToken that keeps the User_Session_data:
public class StandardSessionAuthenticationToken/*<C_extends SecurityContext, T extends SessionStandaloneInformation>*/
    _     _  ___   _     _     _extends UsernamePasswordAuthenticationToken implements AuthenticationDetailsSource {
//  _ private SessionStandaloneInformation details;
  _ protected Collection</*? extends */GrantedAuthority>_authorities;

 _  public StandardSessionAuthenticationToken(Object principal,_Object credentials, String_sessionId, Date_lastRequest) {
 _     _this(principal, credentials, sessionId,_lastRequest, null);
    }

__  public_StandardSessionAuthenticationToken(Object_principal,_Object credentials,_String sessionId, Date_lastRequest
_ __     __      _   __   _    _     _ _ ,_Collection</*? extends */GrantedAuthority> authorities) {
    super(principal, credentials, authorities);
_     _ this.setDetails(new SessionStandaloneInformation(principal, sessionId,_lastRequest) );
__  __ _/*this.*/setAuthorities(authorities);
      _ this.setAuthorities(authorities);
_   }

  _ /**
  __ *
    _* @param context
   _ * @return
  ___*/
    @Override
_   public Object buildDetails(Object_context) {
 _      final_Object_principal = ( (/*C*/SecurityContext)context).getAuthentication().getPrincipal(); //To change_body_of generated methods, choose Tools |_Templates.
__    _ this.setDetails(new SessionStandaloneInformation(principal, ( (SessionStandaloneInformation)getDetails() ).getSessionId(),_new Date() ) );

     _  return_this.getDetails();
    }

//___ @Override
//    public boolean implies(Subject subject) {
//_ _  _  return super.implies(subject); //
//    }
 _  /**
    _* just for back-compatibility purposes (SpringSecurity 2 / SpringSec 3.X+).
 _   */
    public_static class SessionStandaloneInformation extends SessionInformation implements SessionIdentifierAware_{

   __   public SessionStandaloneInformation(Object principal, String_sessionId,_Date_lastRequest)_{
  _  _  _ _ super(principal,