Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Credentials not passed into EJB  RSS feed

John KurtzMan
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

We would like to pass in some credentials (either public or private) into an EJB to pass in meta data about the user (certificate, etc). Using a custom login module, on the client side the code is

Subject subject = loginContext.getSubject();
CustomCred credential = new CustomCred();

Within the EJB, I am trying to pull out the credential thus:

Subject caller = (Subject) PolicyContext.getContext(SUBJECT_CONTEXT_KEY);
Set<?> privateSet = caller.getPrivateCredentials();
Set<?> publicSet = caller.getPrivateCredentials();


The credentials do not show up, but the subject does, as I can get the principal out. I have tried this on glassfish 3.1 and JBoss 5.1, with the same results. Glassfish does put in some authentication information within the private credential, but JBoss does not. Neither seems to support passing in meta data via credentials.

My questions are:
1. Am I doing this correctly?
2. Are Credentials supported in Glassfish or JBoss?
3. If not supported, are there other ways of passing in user meta data?

Thank you in advance

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!