-
1. Re: Call from MDB to SSB is always anonymous
wdfink Jul 14, 2013 2:14 PM (in response to quvad)With AS7 the bahaviour is different.
How does your lookup code look like? What is the difference between AS5 and AS7? I mean which user is used in AS5.
-
2. Re: Call from MDB to SSB is always anonymous
sfcoy Jul 14, 2013 11:45 PM (in response to quvad)1 of 1 people found this helpfulHi there,
What does
{quote}Always... In AS5 everything was fine{quote}
mean?
It's normal for message driven beans to execute without any particular user identity, hence the "anonymous" principal that you're getting. There is a JBossAS extension that allow you to specify a different "run-as-principal" in the jboss-ejb3.xml file, but it will be that constant value every time.
If you need to call the SSB with multiple use identities then you'll need to do a JAAS login first.
-
3. Re: Call from MDB to SSB is always anonymous
quvad Jul 16, 2013 10:40 AM (in response to sfcoy)Thank you for hints. Solved the problem by doing JAAS login in MDB.
-
4. Re: Call from MDB to SSB is always anonymous
a.d.jbpm Aug 20, 2013 11:38 AM (in response to quvad)Hi,
Could you please post your JAAS login you performed in your MDB?
Thanks,
Sam
-
5. Re: Call from MDB to SSB is always anonymous
nehan.dogar Nov 23, 2017 7:09 AM (in response to quvad)How you have done JAAS login, can you please post some code snippets?
-
6. Re: Call from MDB to SSB is always anonymous
irfan.dogar Nov 30, 2017 5:05 AM (in response to quvad)Just posting the sample code of jaas login for completeness:
CallbackHandler handler = new MyCallbackHandler(customUsername, customPassword);
try {
LoginContext loginContext = new LoginContext("mysecurity-domain", handler);
loginContext.login();
subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
} catch (Exception e) {
LOG.error("Can't login");
}
or use loginContext.getSubject() subject is null from PolicyContext.