How to carry out a privileged task to be Run As a user Identity in a plain java class using jboss API ?

Solution Verified - Updated -

Issue

  • How to carry out a privileged task to be Run As a user Identity in a plain java class using jboss API ?
  • Weblogic Code equivalent in JBoss for weblogic.security.Security.RunAs(Subject user, PrivilegedAction action) as specified in Oracle Link
  • The following code is currently used in our application which is in weblogic. Please help how can we replace this in JBoss.
weblogic.security.Security.runAs(
                        SubjectUtils.getAnonymousUser()
                        , MailMessage
                        );

Environment

  • JBoss Enterprise Application Platform (EAP)

    • 5.x
    • 6.x
  • Oracle Weblogic Server (WLS)

    • 8.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.