Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8851

Re: Impersonate user for the UME

$
0
0

Hi Samuli,

 

thank you for your feedback! The problem is, that I have no influence on the client side, i.e. I have only one request, which should be answered in the synchronous way.

 

However just as you, because of security reasons, I didn't really elieve that there is some way to do this, but I found out, that it's possible (thx @ Sergei Haller for the tip). Here the code snippet:


IUser userB= UMFactory.getUserFactory().getUserByLogonID("userB");
Subject subject = new Subject(            true, new HashSet<IUser>(Arrays.asList(new IUser[] { userB})), Collections.emptySet(), Collections.emptySet());
Subject.doAs(subject, new PrivilegedAction<String>() {     @Override     public String run() {               // do the stuff of the method Y     }
});

Thank you and best regards,

Artem


Viewing all articles
Browse latest Browse all 8851

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>