Private Credentials and how to get them back

How to extract back the private credentials in a clean way from weblogic?
We are currently working with bea weblogic version 7
and have developed an authentication module and a credential mapper module
The authentication is fairly simple : the user types in a username and password
and we come into the Authenticator Provider which we configered in our realm
The partial signature of the interface interface javax.security.auth.spi.LoginModule
public void initialize(Subject subject,CallbackHandler callbackHandler,Map sharedState,Map
options)
in the initialize method we store the subject in a private variable
public boolean commit()
in the commit method we add a principal to the subject via
     subject.getPrincipals().add(new Principal(username))
and we add the private credentials as
     subject.getPrivateCredentials().add(new PasswordCredential(username,password))
Now ,
some time later when the user want's to access an ejb that is using a JCA connector
component
and want's to retrieve a connection, we will pass via the Credential Mapper that
we configured in the realm.
The method signature is
public Vector getCredentials(Subject requestor,Subject initiator,Resource resource,String[]
credentialTypes)
The initiator subject represents the user that authenticated himself
I can extract the principal with the method subject.getPrincipals
but when i try to extract subject.getPrivateCredentials i get an empty set.
The questions is of course did weblogic hide away the private credentials or not.
I can work around this but stuffing the password in the principal at the moment
of authentication , but i would prefer a cleaner solution.
Any ideas
Blyau Gino
[email protected]

Is the Subject created in the Authenticator ever serialized or passed across
the wire? If so, anything stored in the private or public credentials will
be removed as part of the serialization process. This is documented in the
JAAS specifications from Sun.
Paul Patrick
"gino blyau" <[email protected]> wrote in message
news:[email protected]...
>
How to extract back the private credentials in a clean way from weblogic?
We are currently working with bea weblogic version 7
and have developed an authentication module and a credential mapper module
The authentication is fairly simple : the user types in a username andpassword
and we come into the Authenticator Provider which we configered in ourrealm
>
The partial signature of the interface interfacejavax.security.auth.spi.LoginModule
>
public void initialize(Subject subject,CallbackHandlercallbackHandler,Map sharedState,Map
options)
in the initialize method we store the subject in a private variable
public boolean commit()
in the commit method we add a principal to the subject via
subject.getPrincipals().add(new Principal(username))
and we add the private credentials as
subject.getPrivateCredentials().add(newPasswordCredential(username,password))
>
>
Now ,
some time later when the user want's to access an ejb that is using a JCAconnector
component
and want's to retrieve a connection, we will pass via the CredentialMapper that
we configured in the realm.
The method signature is
public Vector getCredentials(Subject requestor,Subjectinitiator,Resource resource,String[]
credentialTypes)
The initiator subject represents the user that authenticated himself
I can extract the principal with the method subject.getPrincipals
but when i try to extract subject.getPrivateCredentials i get an emptyset.
The questions is of course did weblogic hide away the private credentialsor not.
>
I can work around this but stuffing the password in the principal at themoment
>
of authentication , but i would prefer a cleaner solution.
Any ideas
Blyau Gino
[email protected]

Similar Messages

Maybe you are looking for

  • MacBook Pro....things you need to know before you buy!!!

    Helpful hints before you buy your MacBook Pro 15 or 17 inch: 1. New MacBook Pro...does not have a firewire 400 port!!. If you have to transfer data from an old (2 years old) MacBook Pro to new one...need a 800 firewire cable or a 400 to 800 cable!! 2

  • Unable to create service central contract items

    Hi Experts We are in SRM 7 EHP 2 ECC 6 EHP 6 We are unable to create Central Contract with Service. There is no "Outline" or "Service" on drop down from ADD LINE in Central Contract. Please help urgently. Thanks Ajit

  • Recursion in Oracle 8i

    Does PL/SQL support recursion in function calls? Does PL/SQL support recursion in procedure calls? is there some papers or info I can get to dig into this. ANy help will be apprecciated Eric Echeverry

  • Workflow with no agents on tasks

    Hello friends, needing some help pls. I am using a WF combined with the Organizational Structure form HR to get the agents for each task.  There you go the doubts: 1.     What can I do or how could I avoid a task for the workflow with no agents on th

  • Regarding stateless bean create() method problem

    hi every body, I am Learning EJB now for this i created one StatelessBean with a eho functionality with jsp. it is working good for the first time but when i am trying to run that jsp once again it shows the following error in server console 11:32:13