Cool idea! Take a look at the 'supports()' method https://shiro.apache.org/static/1.3.2/apidocs/org/apache/shiro/realm/AuthenticatingRealm.html#supports-org.apache.shiro.authc.AuthenticationToken-
You could loop through your collection of realms and pass a Username Password token to them. -Brian On Tue, Jun 13, 2017 at 4:36 PM, volumeint <[email protected]> wrote: > At runtime, I would like to query the shiro library to determine how I > should > prompt my users to login. If I have any "Direct" realms (jdbc, ldap), I > would want to show a username/password form. If I have "Indirect" realms > (oauth, cas), I would want to provide buttons for "Login using > /external-service-x/". If shiro has been configured with both Direct and > Indirect realms, I want my login form to show both options, buttons and a > form. Is this possible directly from Shiro? > > I know how to get the list of configured Realms, but is there a way to > determine if a realm is Direct or Indirect? I'm hoping to avoid > someRealm.getClass().getName().equals(KNOWN_INDIRECT_REALM_IMPL). > > > > > -- > View this message in context: http://shiro-user.582556.n2. > nabble.com/Query-shiro-to-build-login-form-tp7581652.html > Sent from the Shiro User mailing list archive at Nabble.com. >
