I think I found a fix, where instead of adding the principal directly to the
authentication info object:

                        m_principal = new
MyPrincipal(m_usernamePasswordToken.getPrincipal().toString(), sessionId,
m_url.toLowerCase());
                        m_authInfo.addPrincipal(m_principal);

If I get the principal collection from the subject, and add it that way, it
seems to work:

                        m_principal = new
SvtPrincipal(m_usernamePasswordToken.getPrincipal().toString(), sessionId,
m_lamsUrl.toLowerCase());
                        SvtPrincipalCollection p =
(SvtPrincipalCollection)SecurityUtils.getSubject().getPrincipals();
                        if (p == null) {
                                m_authInfo.addPrincipal(m_principal);
                        } else {
                                p.add(m_principal, "lamsRealm");
                        }


I would still appreciate a response to let me know if this approach is
valid.





--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/Add-principals-to-AuthenticationInfo-object-after-doGetAuthenticationInfo-returns-tp7581395p7581396.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to