We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to use a shiro possibility to have multiple realms:
1.) to have in INI realm administrator uses 2.) thru this addon create additional users and authenticate them with their passwords
I've tried to adapt the AuthenticationStrategyForIsisModuleSecurityRealm, but it fails when tries to authentificate the user from addon, but failed.
Here the adapted Strategy, I've varied the subclassing of strategies, actually I would need "AtLeastOneSuccessfulStrategy" but failed
package security; import java.util.Collection; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.pam.AllSuccessfulStrategy; import org.apache.shiro.realm.Realm; /** * Created by niv on 12.04.2016. */ public class AuthenticationStrategyForIsisModuleSecurityRealm2 extends AllSuccessfulStrategy { public AuthenticationStrategyForIsisModuleSecurityRealm2() { } @Override public AuthenticationInfo beforeAllAttempts(Collection realms, AuthenticationToken token) throws AuthenticationException { AuthenticationInfo auth = null; for (Realm realm : realms) { try { auth = realm.getAuthenticationInfo(token); if (auth != null) return auth; } catch (IncorrectCredentialsException e) { System.out.println(e.getMessage()); // catching when single realm throws authentification exception } } throw new AuthenticationException("no provided realms could't authenticate user, realm count:" + realms.size()); } }
Here my shiro.ini:
_[main] isisModuleSecurityRealm=org.isisaddons.module.security.shiro.IsisModuleSecurityRealm authenticationStrategy=security.AuthenticationStrategyForIsisModuleSecurityRealm2 securityManager.authenticator.authenticationStrategy =$authenticationStrategy securityManager.realms = $iniRealm,$isisModuleSecurityRealm [users] # user = password, role1, role2, role3, ... sven = pass, admin_role, isis-module-security-admin dick = pass, user_role, self-install_role bob = pass, user_role, self-install_role joe = pass, user_role, self-install_role guest = guest, user_role [roles] user_role = *:SimpleObjects:*:*,\ *:SimpleObject:*:* self-install_role = *:DomainAppFixtureService:*:* admin_role = * _
The text was updated successfully, but these errors were encountered:
moved to incodehq/incode-platform#38
Sorry, something went wrong.
No branches or pull requests
I would like to use a shiro possibility to have multiple realms:
1.) to have in INI realm administrator uses
2.) thru this addon create additional users and authenticate them with their passwords
I've tried to adapt the AuthenticationStrategyForIsisModuleSecurityRealm, but it fails when tries to authentificate the user from addon, but failed.
Here the adapted Strategy, I've varied the subclassing of strategies, actually I would need "AtLeastOneSuccessfulStrategy" but failed
Here my shiro.ini:
The text was updated successfully, but these errors were encountered: