Take a look the authentication strategy AllSuccessfulStrategy
<https://shiro.apache.org/static/current/apidocs/org/apache/shiro/authc/pam/AllSuccessfulStrategy.html>

You could configure it similar to:
allSuccessfulStrategy=org.apache.shiro.authc.pam.AllSuccessfulStrategy
securityManager.authenticator.authenticationStrategy=$allSuccessfulStrategy

The merged result would be the Principals from both realms.


On Tue, Jul 26, 2016 at 1:48 PM, jonathan.labin <jonathan.la...@gmail.com>
wrote:

> I am currently attempting to display the list of roles applied to the
> current
> user.
> The purpose here is so that the user understands the context in which they
> are using the application and why they may be restricted from certain areas
> of the application.
>
> From reading other discussion threads, it appears this is not a feature
> provided by Shiro so I was attempting to modify my realm to provide this
> information in a principal object to be retrieved elsewhere in the
> application.
>
> The trouble is that I have a 2-realm application where one realm performs
> authentication and a second realm performs authorization only.  I'd like
> the
> authorization-only realm to be able to store the roles loaded as principal
> objects but I haven't found an API mechanism to allow this.
>
> I have been able to use the authorizing realm to retrieve and modify an
> existing principal object created by the authenticating realm.  However,
> this approach ties the realms together in a way that makes my application
> less flexible to configurations which opt for a different authenticating
> realm.
>
> Is there any way for an authorizing realm to ADD principal objects to the
> PrincipalCollection?
> Or better yet, is there any way to request from Shiro a list of roles from
> across all realms?
>
> Thanks,
> Jonathan
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Principal-added-by-AuthorizingRealm-tp7581171.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Reply via email to