Custom login module error: Login permission not granted for myapp (myuser)

I have developed a custom login module for my application. I have followed the steps outlined in security guide and other postings. I could not log into the application when I access EJBs from an RMI client. I get the following error.
Login permission not granted for myapp (myuser)
I did grant the login permission to myuser.
I am using OC4J 10.1.3.1.0
Here are the steps I followed and the configuration files. Can anybody help me out?
1. Created a custom login module and packaged it in EAR along with other classes. In the commit method, I added my user into principals of subject. Here is the code,
==================================================================
public boolean commit() throws LoginException {
try {
if (!loginOk) {
return false;
Set<Principal> principals = subject.getPrincipals();
principals.add(user);
loginOk = true;
} finally {
// Some audit logs are written here.
return loginOk;
===============================================================
2. Added custom login module in orion-application.xml. Here are the relevant portions of orion-application.xml
===============================================================
<jazn provider="XML">
<property name="role.mapping.dynamic" value="true" />
<property name="custom.loginmodule.provider" value="true" />
<property name="role.compare.ignorecase" value="true" />
</jazn>
<jazn-loginconfig>
<application>
<name>myApp</name>
<login-modules>
<login-module>
<class>com.test.myServerLoginModule</class>
<control-flag>required</control-flag>
<options>
<option>
<name>maxRetries</name>
<value>3</value>
</option>
<option>
<name>debug</name>
<value>true</value>
</option>
</options>
</login-module>
</login-modules>
</application>
</jazn-loginconfig>
<namespace-access>
<read-access>
<namespace-resource root="">
<security-role-mapping name="myUser">
<group name="users"/>
<group name="oc4j-app-administrators"/>
</security-role-mapping>
<security-role-mapping name="esp_operator">
<group name="users"/>
<group name="oc4j-app-administrators"/>
</security-role-mapping>
</namespace-resource>
</read-access>
</namespace-access>
===============================================================
3. After the application is deployed on the EAR, I can see the custom login module in system-jazn-data.xml. The command line jazn admin tool lists my custom login module for my application.
4. I have an RMI client, the client JNDI properties are
==============================================================
java.naming.factory.initial=oracle.j2ee.naming.ApplicationClientInitialContextFactory
java.naming.factory.url.pkgs=oracle.j2ee.naming
==============================================================
The value for java.naming.provider.url is constructed dynamically and it is ormi://myserver:23791/myapp
java.naming.security.principal is set to the user who is trying to login, myuser, in this case.
java.naming.security.credentials is set to the password entered by myuser, password in this case.
5. I used jazn admin tool to grant login permission to my user.
===============================================================
a. Added user
java -jar jazn.jar -user oc4jadmin -password welcome -adduser jazn.com myuser password
b. Grant roles
java -jar jazn.jar -user oc4jadmin -password welcome -grantrole users ja
zn.com myuser
java -jar jazn.jar -user oc4jadmin -password welcome -grantrole oc4j-app
-administrators jazn.com myuser
c. Grant RMI permission
java -jar jazn.jar -user oc4jadmin -password welcome -grantperm jazn.com
-user myuser com.evermind.server.rmi.RMIPermission login
===============================================================
After the permission is granted, the folowing piece of XML is added to system-jazn-data.xml.
===============================================================
     <grant>
          <grantee>
               <principals>
                    <principal>
                         <realm-name>jazn.com</realm-name>
                         <type>user</type>
                         <class>oracle.security.jazn.spi.xml.XMLRealmUser</class>
                         <name>jazn.com/esp_administrator</name>
                    </principal>
               </principals>
          </grantee>
          <permissions>
               <permission>
                    <class>com.evermind.server.rmi.RMIPermission</class>
                    <name>login</name>
               </permission>
          </permissions>
     </grant>
==============================================================
My principal class is not of type, oracle.security.jazn.spi.xml.XMLRealmUser. Hence, I changed system-jazn-data.xml to include com.test.MyUser instead of oracle.security.jazn.spi.xml.XMLRealmUser. Either way, I get Not Authorized and Login permission not granted for myapp (myuser).
Can anybody help me out, please?
Thank you,
Sri
Message was edited by:
user532586

I finally got it to work. But I have a problem granting RMI Permission "login", if the depth of my Principal class within the inheritance hierarachy is more than one. My hierarachy of my principal class is
Object --> ObjectA --> ObjectB --> ObjectC --> ObjectD
ObjectD is my principal class. ObjectB implements java.security.Principal. ObjectA has implementations for methods equals, hashcode and toString. ObjectB has implementations for getName.
When I try to grant RMI permission for ObjectD, I get an error that says null.
If I override the methods, equals, hashcode, toString, and getName in ObjectD and provide implementations, I still could not grant permission using jazn tool. I get error that says null. If I update the system-jazn-data.xml with the following grant tag, I could get into the application without any errors.
     <grant>
          <grantee>
               <principals>
                    <principal>
                         <class>com.test.ObjectD</class>
                         <name>developers</name>
                    </principal>
               </principals>
          </grantee>
          <permissions>
               <permission>
                    <class>com.evermind.server.rmi.RMIPermission</class>
                    <name>login</name>
               </permission>
          </permissions>
     </grant>
If I create a new class, myPrincipal that implements java.security.Principal, I donot have any problems. I can grant permission and access application.
Any ideas why I could not use ObjectD as my principal class for granting RMI permission?
Message was edited by:
user532586

Similar Messages

  • [svn] 1978: Bug: vendors. properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly .

    Revision: 1978
    Author: [email protected]
    Date: 2008-06-06 08:05:34 -0700 (Fri, 06 Jun 2008)
    Log Message:
    Bug: vendors.properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly.
    QA: Yes - we need automated tests to make sure that errors.properties and vendors.properties in BlazeDS/LCDS are loaded properly.
    Doc: No
    Modified Paths:
    blazeds/branches/3.0.x/modules/common/src/java/flex/messaging/util/PropertyStringResource Loader.java
    blazeds/branches/3.0.x/modules/opt/src/jrun/flex/messaging/security/JRunLoginCommand.java
    blazeds/branches/3.0.x/modules/opt/src/tomcat/flex/messaging/security/TomcatLoginCommand. java

    I have a lot of grief with this version of Windows Media Player.
    It is very buggy and frustrating to use.
    I have my Music library on a QNAP NAS, which is as reliable as they come.
    System notifications make it not save changes.  It also does not do a good job of interpreting albums and artists from folders.  Changes to track names are not saved, nor are tracks moved to other albums, renamed albums, changes to genre, artist
    or date.  It separates and merges albums/tracks without sense or reason.  Some changes I've made up to 4 times, then closed WMP and re-started my machine to check if it has/hasn't saved the changes.  Often it has not.
    This is the first time I've used WMP in this capacity, and I do not recommend it.
    New service pack please.

  • Database Error: RSR0009: Resource not available for pool. Wait-time expired

    i am occassionally receiving the following error during database connections in my servlet:
    Database Error: RSR0009: Resource not available for pool [webAdvisorTestPool]. Wait-time expired
    i understand that this is a result of a connection leak from improper closure of my Connection object, but i thought that i was properly closing my connection.
    i can get the error if i do the following steps:
    1) access my login page and enter login credentials.
    2) submit the login which then hits the Authentication servlet.
    3) Authentication servlet authenticates and takes me to home page.
    4) hit the back button to get back to the login page.
    5) repeat this process until i hit the Max Pool Size (from web server).
    6) then i get the error message
    here are some details:
    i have an Authentication servlet; here is the pertinent code from that servlet:
    try {     // retrieve the user and add the User object to the session     DAO dao = new DAO();     Person authenticUser = dao.getPerson(userID, password);     session.setAttribute("validUser", authenticUser);     redirectPage = mapping.findForward("success"); }
    i also have a DAO object that handles all of my DB transactions (and you can see from my code above that the Authentication servlet is using that object); here is the pertinant code from that servlet:
    public DAO() {     datasource = "java:comp/env/jdbc/webAdvisorTest"; } public Person getPerson(String userID, String password)     throws ObjectNotFoundException {     // JDBC variables     DataSource ds = null;     Connection conn = null;     PreparedStatement stmt = null;     ResultSet results = null;     // User variables     Person validUser = null;     try     {         // Retrieve the DataSource from JNDI         InitialContext ctx = new InitialContext();         // if this statement fails, NamingException is thrown         ds = (DataSource)ctx.lookup(datasource);         // get DB connection and perform SQL operations         conn = ds.getConnection();         // User variables         String validUserID = null;         String validFName = null;         String validLName = null;         String validEmail = null;         // get DB connection and perform SQL operations         conn = ds.getConnection();         stmt = conn.prepareStatement(PERSON_QUERY);         stmt.setString(1, userID);         stmt.setString(2, password);         results = stmt.executeQuery();         // iterate through the results         if (results.next())         {             validUserID = results.getString("id");             validFName = results.getString("first_name");             validLName = results.getString("last_name");             validUser = new Person(validUserID, validFName, validLName);         }     }     // handle SQL errors     catch(SQLException e)     {         e.printStackTrace(System.err);         throw new RuntimeException("Database Error: " + e.getMessage());     }     // handle JNDI errors     catch(NamingException e)     {         throw new RuntimeException("JNDI Error: " + e.getMessage());     }     // clean up resources     finally     {         doClosure(results, stmt, conn);     }     // if the user was not found, throw ObjectNotFoundException     if(validUser == null)     {         throw new ObjectNotFoundException();     }     return validUser; } protected void doClosure(ResultSet results, PreparedStatement stmt,     Connection conn) {     if (results != null)     {         try { results.close(); }         catch (SQLException e) { e.printStackTrace(System.err); }     }     if (stmt != null)     {         try { stmt.close(); }         catch (SQLException e) { e.printStackTrace(System.err); }     }     if (conn != null)     {         try         {             System.out.println("R18Resources.conn before close: " + conn);             conn.close();             System.out.println("R18Resources.conn after close: " + conn);             System.out.println("R18Resources.conn is closed? " +                 conn.isClosed());         }         catch (SQLException e)         {             System.out.println("R18Resource conn close error: " +                 e.getMessage());         }     } }
    as you can see, i've added some print statements in my connection closure block. based on my output log, each connection is being properly closed and i am not encountering any errors during that closing block.
    any ideas???
    Message was edited by:
    millerand

    Please try the following code in your doClosure method. Replace your code with the following code.
    public void doClosure(ResultSet pResultSet, Statement pStmt, Connection pConn) throws Exception {
    try {
                   if (pResultSet != null) {
                        pResultSet.close();
                        pResultSet = null;
              } catch (SQLException se) {
              logger.error( se );
              } finally {
                   try {
                        if (pStmt != null) {
                             pStmt.close();
                             pStmt = null;
                   } catch (SQLException se) {
                   logger.error(se);
                   } finally {
                        try {
                             if (pConn != null) {
                                  pConn.close();
                                  pConn = null;
                        } catch (SQLException se) {
                        logger.error(se);
    And let me know if you still face this issue. What is the application server you are using?

  • Error CREDIT_SEGMENTS_ADD COIOB NOT FOUND FOR object CC...

    Hi All,
    My user is geting the ERROR while running the actual OH calculation through CJ45 as below:
    Error CREDIT_SEGMENTS_ADD COIOB NOT FOUND FOR object
    Message NO k5011.
    As this is more ralaing to the costing sheet, this refers to controlling module.
    We have verfied the Note 515426, but the correction were delivered in 4.7 itself. My client is using the  6.0 verion.
    Can anybody suggest the reason for the above error.
    Thanks & Regards
    Shankar

    HI,
    whats the message class, message number?
    BR Christian

  • 2013 Custom Web Parts in Page Layouts not showing for users

    Custom Web Parts in Page Layouts not showing for users
    I have created a master page in the root site collection for a subsite I am developing. I created content types and custom page layouts for the pages within the subsite.
    I used the snippet tool in the design manager to create web parts and page field markup which I copied into the custom layout HTML pages in the root site collection. For instance I have an image viewer web part that I place there to serve as a section title.
    The problem is that I can see all these customer layout page parts no problem but my users cannot. This leads me to believe its permissions, I am site owner of both the subsite and root site collection.
    The users that cannot see the web parts are site members of the site and restricted read users on the root site collection (where the layouts are stored).
    What gives I'm finding it hard to understand why a snipet generated web part wouldn't show in all pages created from that layout page.
    Any help would be appreciated, Havent found anything on this issue online. weird.

    It is a permission issue indeed. Fix is simple, make sure you check out the page layout page, then check it back in as published version.
    John Architect

  • When I try to install Adobe Acrobat XI Pro, I get an error message, "Key not valid for use in specified state".  What is this?

    When I try to install Adobe Acrobat XI Pro, I get an error message, "Key not valid for use in specified state".  What is this?

    See if this post by turingtest2 fixes it : key not valid for use in specified state

  • There's an error while delivery note creation for STO order

    There's an error while delivery note creation for STO order  even stock available in unrestricted stock
    Edited by: sharma aman on Nov 8, 2011 9:00 AM

    Dear Sharma Aman,
    Check whether the following link helps you.
    Mesaage : while creation of delivery : An item with no delivery quantity .)
    Please search in google with the error message and definitely you will get some older posts in SDN which is solved.
    In that case , you need not wait for the solution as it is already available.
    If the solution provided do not suit you, then post it in SDN so that it will be a learning for others.
    Try to search in the forum or in google before posting further queries
    Thanks & Regards,
    Hegal K Charles

  • Mapping Error: Mappings are not required for this Integrator

    Hi,
    when I created my upload integrator with the Desktop Integrator Manager (12.1.2) I am not able to attach a mapping to it. I get the following error:
    Mapping Error: Mappings are not required for this Integrator because the ability to download information has not been enabled.
    Does anyone know what I've missed?
    cheers
    Jeroen

    Hi ,
    Without creating the content if you are trying to do mapping this error will come.
    Solution:
    Create the content and then do mapping..
    Regards,
    Sreekanth.S
    Edited by: user12045904 on Dec 9, 2010 10:55 PM

  • ERROR: user is not configured for keystore 'service_ssl'

    hi experts:
    System environment:
    pi7.0  j2ee sp09
    ECC6.0 patch level11
    Here is my scenarios..
    ECC6.0-->(IDOC)XI(CIDX)--
    >External system.
    External system-->(CIDX)XI(IDOC)--
    >ECC6.0
    1.we have got there certificates from external system (rootCA.DER,intermedia.DER,Server.DER), imported the 3 certs files to TrustedCAs view using VA tool after we configured the SSL enable.
    2.We generated the CSR file and got the response from CA. we import the CSR response to SERVICE_SSL service
    3.I have assigned the role(keystoreadministrator) to user(PIAFUSER,PIAPPLUSER) in security provide service.
    4.I configured the IR and ID for the first sceniro. I Selected the "service_ssl" view and "TrustedCAs" view in received agreement in ID, and selected the "service_ssl" view in comunication channeland. actived all of them.
    issue :
    as soon I trigger the message to external. It is OK in monitor for processed XML Message.
    BUT I got the error message in runtime workbench/adapter engine/communication channel mornitoring.
    Channel Name: Buyer_Send_OrderChange
    Receiver Agreement: |com_sap_abap_r3_200|Sell_elemic|CIDX_E45_20_seller|OrderChange
    Security Settings > Current certificate configured for signing:
    ERROR: user is not configured for keystore 'service_ssl'
    Security Settings > Partner certificate configured for signing:
    ERROR: user is not configured for keystore 'TrustedCAs'
    Thanks!!.

    The question have been solved ..
    thanks!
                         xixi

  • ERROR OGG-01148 programming error, data type not supported for column

    I am getting following error when I put null in insert statement
    2011-03-31 18:30:45 ERROR OGG-01148 programming error, data type not supported for column TXID in table advoss.tblaudittrail.
    I am replicating MySQL 5.5.9 to Oracle 11g rel2 via goldengate 11

    I am able to diagnose what is cuasing the problem
    unsigned flag was the culprit of this error
    I am able to insert null after removing unsigned flag.
    thank you very much for your kind support

  • I'm getting this error message: "User not registered for online use" when i'm trying to download music/ track names from a CD into ITunes on my Windows 8 PC.  I'm registered and my itunes account/ appleID are all correct and working.

    I'm getting this error message: "User not registered for online use" when i'm trying to download music/ track names from a CD into ITunes on my Windows 8 PC.  I'm registered and my itunes account/ appleID are all correct and working.

    The ""not recognized for on-line use". error is associated with the Gracenote service that iTunes uses to look up and retrieve metadata for CDs.  Some users have reported that this error occurs when trying to import from CD, subsequent to upgrading to version 12.  A number of slightly different solutions have been reported (though all of a similar nature).
    Try walking through the following steps - before starting you may have to enable hidden files and folders to be viewed - in Windows 7 / Windows Explorer select Organize > Folder and search options, then on the View tab make sure that Show hidden files, folders and drives is selected.  Without this you won't see the AppData folder in C:\Users\username\
    Exit iTunes
    In Windows Explorer, go to the folder C:\Users\username\AppData\Roaming\Apple Computer\iTunes
    Delete the following files:
    CD Info.cidb
    com.apple.iTunes.Gracenote.plist
    Restart iTunes
    Insert a CD and see if details are now correctly retrieved from Gracenote
    If this doesn't work:
    In iTunes, select Edit > Preferences and make a note (or take a screenshot) of your preferences settings in all relevant tabs
    Exit iTunes
    In Windows Explorer, go to the folder C:\Users\username\AppData\Roaming\Apple Computer\iTunes
    Delete the following file:iTunesPrefs.xml
    Restart iTunes
    Insert a CD and see if details are now correctly retrieved from Gracenote
    If this second procedure does work, you'll need to restore other iTunes preferences settings to those that you noted in step 1.
    If this one didn't work:
    Exit iTunes
    Check the following folders:
    C:\Users\username\AppData\Local\Apple Computer\iTunes
    C:\Users\username\AppData\LocalLow\Apple Computer\iTunes
    Delete any copies of the following files:
    CD Info.cidb
    com.apple.iTunes.Gracenote.plist
    iTunesPrefs.xml
    Restart iTunes
    Insert a CD and see if details are now correctly retrieved from Gracenote
    Again, if this procedure does work, you'll need to restore other iTunes preferences settings to those that you noted in step 1 of the second procedure. If you're still not able to retrieve CD info:
    Exit iTunes
    In Windows, select Start > Control Panel > Programs and Features.  Find the entry for iTunes, right-click and select Repair.
    When this process has finished, restart iTunes
    Insert a CD and see if details are now correctly retrieved from Gracenote
    If none of these have worked (and almost everything I've seen suggests you should be OK by this point), you may have an issue with the installation and configuration of iTunes itself.  If you have got this far, see turingtest2's notes on Troubleshooting issues with iTunes for Windows updates for advice on how to remove and replace of all components of iTunes.

  • Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state

    we have developed packages to do the followings
    Extract data from DB2 Source and put it in MS Sql Server 2008 database (Lets Say DatabaseA).From MS Sql Server 2008 (DatabaseA)
    we will process the data and place it in another database MS Sql Server 2008 (DatabaseB)
    We have created packages in BIDS..We created datasource connection in Datasource folder in BIDS..Which has DB2 Connection and both Ms Sql Server connection (Windows authentication-Let
    say its pointing to the server -ServerA which has DatabaseA and DatabaseB).The datasource connections will be used in packages during development.
    For deployment we have created Package Configuration which will have both DB2 Connection and MS SqlServer connection in the config
    We deployed the packages in different MS SqlServer by changing the connectionstring in the config for DB2 and MS SqlServer...
    While runing the package we are getting the following error message
    Code: 0xC0016016     Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for
    use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
    ilikemicrosoft

    Hi Surendiran,
    This is because the package has been created by somebody else and the package is being deployed under sombody else's account. e.g. If you are the creator then the package is encryption set according to your account and the package setup in SQL server is
    under a different user account.
    This happens because the package protection level is set to EncryptSensitiveWithUserKey which encrypts
    sensitive information using creator's account name.
    As a solution:
    Either you have to set up the package in SQL server under your account (which some infrastructures do not allow).
    OR
    Set the package property Protection Level to "DontSaveSensitive" and add a configuration file
    to the package and set the initial values for all the variables and all the connection manager in that configuration file (which might be tedious of-course).
    OR
    The third options (which I like do) is to open the package file and delete the password encryption entries from the package. Do note that this is not supported by designer and every time you make changes to the connection managers these encryption entries come
    back.
    Hope this helps. 
    Please mark the post as answered if it answers your question

  • FBVB error msg "Transaction not defined for direct call-up"

    Dear Gurus,
    Pls help me on issues below:-
    1.)What is the diff between FBV0 and FBVB?
    2.)When i try to initialize FBVB. I received an error "Transaction FBVB not defined for direct call-up. Can u teach me how to fix it up coz one of my end-user requested this T-code.
    Thanks.

    Nothing needs to be fixed - the transaction is called behind the scenes when the user uses FBV0 to post a parked document.  Users should never call FBVB directly.
    Andrew

  • ESS Business Package Error: Period type not allowed for profile ESS

    Hi,
    We are trying to configure the business package for Employee Self Service on Enterprise Portal 6.0. We followed this SDN contribution <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/21eb036a-0a01-0010-25a3-b2224432640a">ESS doc guide</a>
    So far we have successfully deployed the business packages and followed all the configurations that were pointed out in the doc guide. Unfortunately when we try to access the Employee Self-Service portal pages (Overview, Employee Search, etc), we encounter this error:
    Critical Error:
    Period type not allowed for profile ESS, error key: RFC_ERROR_SYSTEM_FAILURE
    com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException:      Period type not allowed for profile ESS, error key: RFC_ERROR_SYSTEM_FAILURE
    Any ideas on how to fix this issue?
    Regards,
    Jojo

    Hi Jojo,
    Have you solved the problem? If yes can you please help me even I am facing the same error.
    this is very help full to me .
    Thanks and Regards,
    Shilpi.

  • Can't download iTunes, error message "Key not valild for use in specified state"

    I can't download iTunes, keep getting error message "Key not valid for use in specified state"  I uninstalled and tried reinstalling but same issue.

    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\<User>\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

Maybe you are looking for