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

Reply via email to