You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Ivan Dubrov (JIRA)" <de...@geronimo.apache.org> on 2005/06/10 11:16:48 UTC

[jira] Created: (GERONIMO-668) Unable to determine username from EJB method

Unable to determine username from EJB method
--------------------------------------------

         Key: GERONIMO-668
         URL: http://issues.apache.org/jira/browse/GERONIMO-668
     Project: Geronimo
        Type: Bug
    Versions: 1.0-M4    
    Reporter: Ivan Dubrov


When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:

[org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (GERONIMO-668) Unable to determine username from EJB method

Posted by "Aaron Mulder (JIRA)" <de...@geronimo.apache.org>.
    [ http://issues.apache.org/jira/browse/GERONIMO-668?page=comments#action_12316849 ] 

Aaron Mulder commented on GERONIMO-668:
---------------------------------------

That works for me too.  We could even make it an interface that extends Principal, so a custom LoginModule could either have one of their principal classes implement it or add a separate Gernoimo LoginModule that just adds a trivial implementation based on the login username (thus keeping the Geronimo interface out of an otherwise portable custom login module).  I think it should be pretty obvious how to apply it to our own login modules.  And when the server needs to reply to getCallerPrincipal, it can scan the principals and return the first one that implements that interface, or if none do, just the first principal it comes across.

> Unable to determine username from EJB method
> --------------------------------------------
>
>          Key: GERONIMO-668
>          URL: http://issues.apache.org/jira/browse/GERONIMO-668
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0-M4
>     Reporter: Ivan Dubrov
>     Assignee: David Jencks
>      Fix For: 1.0-M4, 1.0-M5

>
> When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:
> [org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]
> Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (GERONIMO-668) Unable to determine username from EJB method

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-668?page=all ]
     
David Jencks closed GERONIMO-668:
---------------------------------

    Resolution: Fixed

Implemented by adding  a GeronimoCallerPrincipal interface, making GeronimoUserPrincipal implement it, and returning it preferentially for getCallerPrincipal.  Reuse of GeronimoUserPrincipal may possibly lead to confusion if there are several login modules all adding GeronimoUserPrincipal instances, but this seems somewhat unlikely.

Sending        modules/security/src/java/org/apache/geronimo/security/ContextManager.java
Adding         modules/security/src/java/org/apache/geronimo/security/realm/providers/GeronimoCallerPrincipal.java
Sending        modules/security/src/java/org/apache/geronimo/security/realm/providers/GeronimoUserPrincipal.java
Adding         modules/security/src/test/org/apache/geronimo/security/ContextManagerTest.java
Transmitting file data ....
Committed revision 232906.

> Unable to determine username from EJB method
> --------------------------------------------
>
>          Key: GERONIMO-668
>          URL: http://issues.apache.org/jira/browse/GERONIMO-668
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0-M4
>     Reporter: Ivan Dubrov
>     Assignee: David Jencks
>      Fix For: 1.0-M5

>
> When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:
> [org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]
> Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (GERONIMO-668) Unable to determine username from EJB method

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
    [ http://issues.apache.org/jira/browse/GERONIMO-668?page=comments#action_12316851 ] 

David Jencks commented on GERONIMO-668:
---------------------------------------

I like the interface idea.

> Unable to determine username from EJB method
> --------------------------------------------
>
>          Key: GERONIMO-668
>          URL: http://issues.apache.org/jira/browse/GERONIMO-668
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0-M4
>     Reporter: Ivan Dubrov
>     Assignee: David Jencks
>      Fix For: 1.0-M4, 1.0-M5

>
> When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:
> [org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]
> Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (GERONIMO-668) Unable to determine username from EJB method

Posted by "Ivan Dubrov (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-668?page=all ]

Ivan Dubrov updated GERONIMO-668:
---------------------------------

    Description: 
When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:

[org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]

Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

  was:
When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:

[org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]




> Unable to determine username from EJB method
> --------------------------------------------
>
>          Key: GERONIMO-668
>          URL: http://issues.apache.org/jira/browse/GERONIMO-668
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0-M4
>     Reporter: Ivan Dubrov

>
> When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:
> [org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]
> Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (GERONIMO-668) Unable to determine username from EJB method

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-668?page=all ]
     
David Jencks closed GERONIMO-668:
---------------------------------

    Fix Version: 1.0-M4
                 1.0-M5
     Resolution: Invalid
      Assign To: David Jencks

Basically, the problem is that getCallerPrincipal's behavior is undefined.  We can't figure out an appropriate way to decide which of the 1001 principals in a subject should bet returned.  If this is really important, make sure you login module only puts one principal into the Subject, containing the information you want to retrieve from the ejb.

> Unable to determine username from EJB method
> --------------------------------------------
>
>          Key: GERONIMO-668
>          URL: http://issues.apache.org/jira/browse/GERONIMO-668
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0-M4
>     Reporter: Ivan Dubrov
>     Assignee: David Jencks
>      Fix For: 1.0-M4, 1.0-M5

>
> When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:
> [org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]
> Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (GERONIMO-668) Unable to determine username from EJB method

Posted by "Alan Cabrera (JIRA)" <de...@geronimo.apache.org>.
    [ http://issues.apache.org/jira/browse/GERONIMO-668?page=comments#action_12316845 ] 

Alan Cabrera commented on GERONIMO-668:
---------------------------------------

What about having a special Geronimo class that is designated as by Geronimo as primary, then have a convention where a special login module would insert it into the subject?  This way, people could have a variety of schemes to insert the primary principal by simply writing their own login module that followed the convention and we wouldn't have to have an "uber" metadata and code to handle all the different possibilities.

> Unable to determine username from EJB method
> --------------------------------------------
>
>          Key: GERONIMO-668
>          URL: http://issues.apache.org/jira/browse/GERONIMO-668
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0-M4
>     Reporter: Ivan Dubrov
>     Assignee: David Jencks
>      Fix For: 1.0-M4, 1.0-M5

>
> When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:
> [org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]
> Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (GERONIMO-668) Unable to determine username from EJB method

Posted by "Aaron Mulder (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-668?page=all ]
     
Aaron Mulder reopened GERONIMO-668:
-----------------------------------


I think we need to look at this issue in more detail.  I believe the app servers I've used all managed to pick out the "user" principal to return from getCallerPrincipal, and every time I've used it it's been with the intention of identifying the login name of the current user.   It seems that most login modules produce both a "user" and at least one "group" principal.  We need to be able to figure out which principal class is "primary" and should be returned from getCallerPrincipal.  It seems like this could be metadata we associate with the login module or realm.

> Unable to determine username from EJB method
> --------------------------------------------
>
>          Key: GERONIMO-668
>          URL: http://issues.apache.org/jira/browse/GERONIMO-668
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0-M4
>     Reporter: Ivan Dubrov
>     Assignee: David Jencks
>      Fix For: 1.0-M4, 1.0-M5

>
> When calling EJB method from the Web module some important security context information (username) is lost.  It is impossible to determine caller user name from the EJB method. EJBContext.getCallerPrincipal().getName() returns something like this:
> [org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal: manager]
> Note that only group name can be determined from this string or from the EJBMethod.getCallerPrincipal().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira