protected void assertRealmsConfigured() throws IllegalStateException { Collection<Realm> realms = getRealms(); if (CollectionUtils.isEmpty(realms)) { String msg = "Configuration error: No realms have been configured! One or more realms must be " + "present to execute an authentication attempt."; throw new IllegalStateException(msg); } }
Collection<Realm> realms = getRealms(); if (realms.size() == 1) { return doSingleRealmAuthentication(realms.iterator().next(), authenticationToken);
/** * First calls <code>super.onLogout(principals)</code> to ensure a logout notification is issued, and for each * wrapped {@code Realm} that implements the {@link LogoutAware LogoutAware} interface, calls * <code>((LogoutAware)realm).onLogout(principals)</code> to allow each realm the opportunity to perform * logout/cleanup operations during an user-logout. * <p/> * Shiro's Realm implementations all implement the {@code LogoutAware} interface by default and can be * overridden for realm-specific logout logic. * * @param principals the application-specific Subject/user identifier. */ public void onLogout(PrincipalCollection principals) { super.onLogout(principals); Collection<Realm> realms = getRealms(); if (!CollectionUtils.isEmpty(realms)) { for (Realm realm : realms) { if (realm instanceof LogoutAware) { ((LogoutAware) realm).onLogout(principals); } } } } }
protected void assertRealmsConfigured() throws IllegalStateException { Collection<Realm> realms = getRealms(); if (CollectionUtils.isEmpty(realms)) { String msg = "Configuration error: No realms have been configured! One or more realms must be " + "present to execute an authentication attempt."; throw new IllegalStateException(msg); } }
Collection<Realm> realms = getRealms(); if (realms.size() == 1) { return doSingleRealmAuthentication(realms.iterator().next(), authenticationToken);
/** * First calls <code>super.onLogout(principals)</code> to ensure a logout notification is issued, and for each * wrapped {@code Realm} that implements the {@link LogoutAware LogoutAware} interface, calls * <code>((LogoutAware)realm).onLogout(principals)</code> to allow each realm the opportunity to perform * logout/cleanup operations during an user-logout. * <p/> * Shiro's Realm implementations all implement the {@code LogoutAware} interface by default and can be * overridden for realm-specific logout logic. * * @param principals the application-specific Subject/user identifier. */ public void onLogout(PrincipalCollection principals) { super.onLogout(principals); Collection<Realm> realms = getRealms(); if (!CollectionUtils.isEmpty(realms)) { for (Realm realm : realms) { if (realm instanceof LogoutAware) { ((LogoutAware) realm).onLogout(principals); } } } } }
protected void assertRealmsConfigured() throws IllegalStateException { Collection<Realm> realms = getRealms(); if (realms == null || realms.isEmpty()) { String msg = "Configuration error: No realms have been configured! One or more realms must be " + "present to execute an authentication attempt."; throw new IllegalStateException(msg); } }
/** * First calls <code>super.onLogout(principals)</code> to ensure a logout notification is issued, and for each * wrapped {@code Realm} that implements the {@link LogoutAware LogoutAware} interface, calls * <code>((LogoutAware)realm).onLogout(principals)</code> to allow each realm the opportunity to perform * logout/cleanup operations during an user-logout. * <p/> * Shiro's Realm implementations all implement the {@code LogoutAware} interface by default and can be * overridden for realm-specific logout logic. * * @param principals the application-specific Subject/user identifier. */ public void onLogout(PrincipalCollection principals) { super.onLogout(principals); Collection<Realm> realms = getRealms(); if (realms != null && !realms.isEmpty()) { for (Realm realm : realms) { if (realm instanceof LogoutAware) { ((LogoutAware) realm).onLogout(principals); } } } } }
Collection<Realm> realms = getRealms(); if (realms.size() == 1) { return doSingleRealmAuthentication(realms.iterator().next(), authenticationToken);