How to authenticate (JAAS) a user programmatically for batch processing

HI,
We're struggling to get our batch user proper authenticated and authorized to enable the batch user to execute various jobs. The Jobs are initially executed by a Quartz scheduler which in turn invokes to execute method on the specific batch job controller class. In this class we'll like to login the batch user before the processing starts and again logout the user before the jobs ends. The batch job processing does some updates on security protected entities - that's where the problems starts. To be able to update certain ADF Entities, the batch user must be in "batch-role". The permissions is configured in the jazn-data.xml file. ADF Security is enabled for the project and various entities is security protected. The application is deployed in one EAR file in into Weblogic 10.3.5. We're using JDeveloper 11.1.2.1.
When we login to the application through the login form in the application, then the security permissions is applied as they should and only users with the correct roles is able to update certain security protected entities. The login form uses something like this, to authenticate the user:
Subject subject = weblogic.security.services.Authentication.login(handler);
weblogic.servlet.security.ServletAuthentication.runAs(mySubject, request);
We'd like to do the same kind of authentication in the batch controller class, like:
Subject subject = weblogic.security.services.Authentication.login(new BatchLoginCallBackHandler());
weblogic.security.Security.runAs(subject,
new PrivilegedAction() {
public Object run() {
try {
executeJob(jec);
} catch (JobExecutionException e) {
e.printStackTrace();
return null;
But this doesn't work. When the job accesses ADFContext.getSecurityContext() it isn't the correct user which is logged in (actually it is the users which initially started the scheduler). And even thouth
boolean inBatchRole = aDFContext.getSecurityContext().isUserInRole("batch-role");
returns true, the user is not allowed to update entities which requires this role to allow an update. It some how seems to, that the login does affect the ADF application module (ADF Context).
We've tried a lot of other things but we're not able to login the batch user in the same way as the ADF Faces are.
Can anyone please help us?
Regards
Jacob

We have the same requirement.
We've tried these approaches, with no success:
AuthenticationService vAuthenticationService = AuthenticationServiceUtil.getAuthenticationService();
vAuthenticationService.login("user", "password");
resulting in Caused By: oracle.adf.share.security.ADFSecurityRuntimeException: EXC_UNSUPPORTED_AUTHENTICATION_OPERATION
and JAASAuthenticationService authService = new JAASAuthenticationService();
authService.login("user", "password");
Caused By: java.security.AccessControlException: access denied (oracle.security.jps.JpsPermission AppSecurityContext.setApplicationID.default)
If I test these methods in a simple java class's main method, they work.
I feel I'm missing something, could somebody please tell me if I'm thinking wrong: We have an application made of a Model project, a UI project(ADF) and a scheduler project(Quartz). Both the UI project and the scheduler use the Model project(ADF BC). We deploy 2 ears, one for the UI and one for the scheduler. The UI application's security is working just fine, and it's about time we enforce security for the scheduler. Scheduler has a Listener that extends QuartzListener, witch implements ServletContextListener. In the contextInitialized we launch different jobs using quartz. How could we make these jobs authenticate using some predefined user credentials?

Similar Messages

  • How to set the number of sockets for batch processing at runtime?

    Hello all,
    I need to change the execution model at runtime. I have achieved this by setting the 'ModelPath' property of the sequence file at runtime. When I set the sequence file model as batchmodel, i need to set the number of test sockets also dynamically. How can this be done? Once i set the number of sockets, i would also have to set the UUT serial number for each socket. Please help me out in solving this.
    Thanks and Regards
    Madhu Srinivasan.

    Hi Madhu,
        You can do this by inserting a sequence file callback into your main sequence and choose the ModelOptions callback. You can then use the expression step to set the "Parameters.ModelOptions.NumTestSockets" value to whatever you want. If you then use the Test UUTs execution entry point you will be prompted for serial numbers automatically. You could also use this same procedure but alter the ModelOptions callback in the process model directly, either way works just as well but I think that using a sequence file callback gives a bit more flexibility in the system.
    Hope this helps,
       Nick

  • How can i obtain a user guide for the ipod nano 16GB 5th gen. with out printing it off the computor

    How can i obtain a user guide for the ipod nano 16GB 5th gen. without printing it off the computor.

    You can't, at least not the one provided by Apple.
    B-rock

  • How to find the exact user exit for our requirement?

    Dear Mr. keerthi,
    can you please explain me how to find the exact user exit for our requirement?

    Hi sandip
    There is more than one method in which you can check for user-exits.The following method is used very often.
    <b>How to find the exact user-exit for your requirement.</b>
    1.     You can check the user exists using transaction SE85.
    2.     Repository Information System -> Enhancements -> Customer exits
    3.     You can search the user-exits by package name.
    4.     Double click on each exit name to check the function module exits.
    <b>The procedure to find the package name.</b>
    Execute transaction SE93 
    Enter the tcode of the transaction for which you want to check the user exit.
    Example: if you want to find the user-exit for purchase orders while changing, enter ME22n  and press display.
    You will get to see the package name
    But you need to confirm that the user exit will get triggered at the appropriate event.
    ( example: you might want some validations to be done ON SAVE of a purchase order)
    <b>Checking if the user-exit is getting triggered or not.</b>
    1.     Open the user exit function module (that you have got in step 4) in Tcode SE37.
    2.     Click on where used button. In the pop up that immediately appears choose only programs .
    3.     You will get a list of programs. Double click on the program name.
    4.     You will get the list of location where this function module user exit is used.
    5.     Place session break points at each of these location ( at each CALL FUNCTION statement)
    6.     Now go to your transaction ( say change purchase order tcode:Me22n) and check if the user exit is getting triggered on appropriate event.
    regards,
    Prasad

  • How to find the appropriate user exit for invoic02 idoc in idoc_output_invo

    Hi all,
    I am new to this community p
    i have issue regarding  the How to find the appropriate user exit for invoic02 idoc in idoc_output_invoic function module.........
    thanks,

    Hi ,
    welcome to SDN.
    You can select the appropriate Customer exit accrding to the available parameters .
    The list of exits available are 
    EXIT_SAPLVEDF_001
    EXIT_SAPLVEDF_002
    EXIT_SAPLVEDF_003
    EXIT_SAPLVEDF_004
    For Example , if you want  to modify the Idoc data(EDIDD) you have to use the EXIT_SAPLVEDF_002. accodingly you can select the user exit according to the avaialable parametres.Use Table MODSAP fto get the Enhancement name.
    Hope this Helps
    Rgds
    Sree
    Edited by: Sree on Jul 23, 2010 12:11 PM

  • How do i download a user guide for a samsung lll ?

    How do I download a user guide for my samsung lll ?

    ^That's a Samsung Intensity user guide. This is a Galaxy S III forum.
    Here's the link for the SIII user guide from Samsung. A quick google search found it. http://downloadcenter.samsung.com/content/UM/201207/20120706131108550/VZW_SCH-i535_English_User_Manual_LG1_F5.pdf

  • How do I find a user quide for pages on my iPad

    How do I find a user quite for pages on my iPad?

    http://help.apple.com/pages/ipad/1.6.1/

  • How can I get a user manual for my inherited Blackberry ...

    How can I get a user manual for my inherited Blackberry Curve 8330?

    Hi and Welcome to the Forums!
    Here is a link to the manuals:
    http://na.blackberry.com/eng/support/docs/subcategories/?userType=1&category=BlackBerry+Smartphones&...
    Cheers!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How can I get a "user guide" for Elements 8?

    How can I get a "user guide" for Elements 8?

    See here (scroll down.):
    http://muvipix.com/products.php?subcat_id=44http://muvipix.com/products.php?subcat_id=44http://muvipix.com/products.php?subcat_id=44
    and here (Scroll to the bottom of page 2):
    http://www.amazon.com/s/ref=sr_pg_2?rh=n%3A283155%2Cn%3A%211000%2Cn%3A5%2Cp_27%3ASteve+Gri setti&page=2&ie=UTF8&qid=1370352322

  • How to provide an exchange user permission for Mailbox Archieve ??

    i want to grant a IT guy access to archive mailboxes. How to provide an exchange user permission for Mailbox Archive ??.
    Regards, h9ck3r.

    Hi,
    Per my known, if you want to access other user's personal archive mailbox, you need to assign full access permissions to primary mailbox first.
    There is no way to grant full access permissions to archive mailbox only.
    Best regards,
    Belinda Ma
    TechNet Community Support

  • How do I change the User Agent for Safari on my iPad?  I need this for a specific website for work.

    How do I change the user agent for Safari on my iPad?  I know how to do it on my desktop version, but I need it for my iPad.

    You can rename the iPad here:
    Settings - General - About - Name
    For Siri make sure he has himself as a contact in the Contacts app then:
    Settings - General - Siri - My Info and select his contact info

  • How do u handle the user parameters for a currency field.

    How do u handle the user parameters for a currency field.
       Decimal saperator and a hundreds saperator. (depending upon the user parametes set for the user the saperators may differ)
          Eg: currency field: 13.896,01 (In this case u2018,u2019 is a thousand saperator and u2018.u2019 is a decimal saperator) How to handle this one.
    Regards,
    Ram.

    Hi,
    Try this code....
    DATA: V_KURSF1 TYPE c LENGTH 10,
            v_kursf2 type c LENGTH 10,
            v_dcpfm    TYPE xudcpfm, "Decimal or Thousand Notation
            v_thousand TYPE char1,   "Thousands Notation
            v_decimal  TYPE char1.   "Decimal Notation
      CONSTANTS:    c_x      TYPE char1 VALUE 'X',
                    c_y      TYPE char1 VALUE 'Y',      "Value Y
                    c_comma  TYPE char1 VALUE ',',      "Comma
                    c_point  TYPE char1 VALUE '.',      "point
                    c_blank  TYPE char1 VALUE ' '.      "Blank
      IF v_dcpfm IS INITIAL.
        SELECT SINGLE dcpfm
        FROM usr01
        INTO v_dcpfm
        WHERE bname = sy-uname .
        IF sy-subrc = 0.
          CASE v_dcpfm.
            WHEN c_x.
              v_decimal  = c_point.
              v_thousand = c_comma.
            WHEN c_blank.
              v_decimal  = c_comma.
              v_thousand = c_point.
            WHEN c_y.
              v_decimal  = c_comma.
              v_thousand = c_blank.
          ENDCASE.
        ENDIF.
       ENDIF.
               Find c_point in  wa_segment-exchange_rate.  ( Eg:ield)
              if sy-subrc = 0.
                replace c_point in wa_segment-exchange_rate with v_decimal.
              endif.

  • How can we restrict the users/planners for a planning book?

    Hi experts,
    How can we restrict the users/planners for a planning book?
    Thanks,
    Naga.

    Hi Naga,
    we describe this in our SAP Demand and Supply Network Planning rapid-deployment solution.
    Access this area directly via
    http://service.sap.com
    /rds-dpa
    In the configuration guide Demand Planning Settings, Macros and Chart
    Engine (DP3) read Appendix: Setting up Roles and
    Authorizations.
    BR Frank

  • How can I define the possible entries for "invoicing process" at fkkinv_ma?

    At the transaction code fkkinv_ma, I fill in the fields "Date ID" and "Identification" but I have a problem with the field of "Invoicing Process". When I psh theF4 button, there comes no search help. What should I do? Should I define the possible entries first? If I should, how can I define the possible entries for "invoicing process"? How is the customization done?
    Thanks in advance for the answers.

    You have to define them in the IMG 
    Financial Accounting (new)
    Contract Account Recievable and Payable
    Business Transactions
    Invoicing
    Invoice Types
    You have to set up a number range, decide what type of Financial transactions should not be invoiced -- like  Dunning Charges
    then you have to have a developer create the form and form class of invoice.

  • User Exit  for Inbound Process - Changing IDOC control record

    Hi,
    I want to utilize the identification field (under details tab) of the IDOC Control Record. What is the suitable user exit for inbound process that i can use to change the IDOC control record?

    It's been a long time since I have done any IDOC processing. 
    Go to SE37 and enter the function module IDOC_INPUT_ORDERS.  Display the source code.  Search for "CALL CUSTOMER".  You should see several "CALL CUSTOMER-FUNCTION" lines.  These are enhancements where you can manipulate the IDOC data.  If you locate the correct one (where the data is read from the IDOC but not yet validated), you should be able to map the partner function value.  Double-clicking on the number in quotes will bring you to an "EXIT_" function module.  A "ZX" INCLUDE program is referenced.  If you haven't used the exit yet, double-clicking on the ZX INCLUDE will create it.  The values passed into the function module are available in the INCLUDE.
    Ideally, you should create a project in transaction CMOD that references the chosen enhancement.  This way you can activate/deactivate without commenting/uncommenting the code in the INCLUDE.

Maybe you are looking for

  • Error while opening SCDPM 2012 r2 console

    Hi, on a new SCDPM 2012 R2 UR3 console only the user that performed the installation is able to open the console. All other users are not able to. Those other users are members of local admin group and some also sysadmin on DPM instance of SQL Server

  • Canon SD 750 Elph not recognized by iPhoto '08

    Hi discussions. This is just an answer to a problem I was having and might be helpful to anyone having iPhoto camera connection problems. First off, I have four apple computers; three running 10.4.11 and one, a new 2.8ghz MacBook Pro, running 10.5.5.

  • Photoshop CS6 & Bridge CS5

    Presently I have installed on my computer (Windows platform) Photosop extended, Dreamweaver, Premiere pro, encore, all of them CS5 Can I upgrade only Photoshop to CS6 with Bridge CS6 ?? Will Bridge CS6 co-exist with Bridge CS5, or will it overwrite B

  • Why isn't my JTree revalidation the scrollpane?

    I've got a class that expands JPanel which contains another JPanel, and a JTree inside a JScrollPane. But the ScrollPane is not activated - when I expand the JTree the nodes are just shown behind the JPanel ... anyone know why?

  • Two POP in Library Users. POP- and POP/

    Hi, I continue to struggle to get my mail straightened out. Thanks for the help In Library/mail I have two POP entries POP - and POP / Both have the following mail range POP/ 2141 to 26189 and POP / 26303 to 42087. I would like to merge the messages