Hi Hasintha, IdentityStore is transient in the User object. You can serialize and store it in your side. When you want to retrieve claims for the specified user, you can use the unique user id of that user to re-retrieve user object from IdentityStore (Through RealmService). This user will be cached in the IdentityStore side and when you retrieve the user 2nd time it'll be from cache most probably.
Thanks! *Jayanga Kaushalya* Software Engineer Mobile: +94777860160 WSO2 Inc. | http://wso2.com lean.enterprise.middleware On Sat, Mar 11, 2017 at 8:49 PM, Hasintha Indrajee <[email protected]> wrote: > Hi Jayanga, > > So what happens if we want to store user objects and then later if we want > to retrieve user objects and try to access claims ? . Here we are storing > user objects in authentication context, not in the identity store. And how > are we storing user objects in the cache when the instance of identity > store is neither serializable nor transient ? > > On Sat, Mar 11, 2017 at 8:34 PM, Jayanga Kaushalya <[email protected]> > wrote: > >> Hi Harsha, >> >> It was designed to be like that. User object will be cached in the >> IdentityStore. So when you retrieving the user object from IdentityStore >> again, it will be most probably from cache instead of connector. >> >> Thanks! >> >> *Jayanga Kaushalya* >> Software Engineer >> Mobile: +94777860160 <+94%2077%20786%200160> >> WSO2 Inc. | http://wso2.com >> lean.enterprise.middleware >> >> On Sat, Mar 11, 2017 at 7:41 PM, Harsha Thirimanna <[email protected]> >> wrote: >> >>> Hi All, >>> >>> In identity gateway, we have to cache the User object that is retrieved >>> from user core within the authentication context and session context. After >>> some times we have to get that user object and want to get the claims since >>> it has the claim API within user object itself. But because of the >>> IdentityStore is non Serializable and make it transient, it will not >>> stored with the User object when it cached, so we can't call the getCalim >>> method in User object now. >>> >>> What I did is, get the user unique id from the user object that is >>> stored in the cache and call the RealmService and get the User object again >>> from the user core when it required. Is that the right behaviour that we >>> expect in the new user core design or did I missed something ? >>> >>> >>> public class User implements Serializable { >>> private static final long serialVersionUID = 21578845544565554L; >>> private String uniqueUserId; >>> private String domainName; >>> private String state; >>> private transient IdentityStore identityStore; >>> >>> thanks >>> >>> *Harsha Thirimanna* >>> *Associate Tech Lead | WSO2* >>> >>> Email: [email protected] >>> Mob: +94715186770 <+94%2071%20518%206770> >>> Blog: http://harshathirimanna.blogspot.com/ >>> Twitter: http://twitter.com/harshathirimann >>> Linked-In: linked-in: http://www.linkedin.com/pub/ha >>> rsha-thirimanna/10/ab8/122 >>> <http://wso2.com/signature> >>> >> >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > Hasintha Indrajee > WSO2, Inc. > Mobile:+94 771892453 <+94%2077%20189%202453> > >
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
