@Override public boolean hasAuthorities(String... authorities) { for (String authority : authorities) { if (!hasAuthority(authority)) { return false; } } return true; }
@Override public void setVaadinSecurity(VaadinSecurity vaadinSecurity) { security = vaadinSecurity; applicationContext = security.getApplicationContext(); }
/** * {@inheritDoc} */ public void login(Authentication authentication) throws AuthenticationException, Exception { login(authentication, false); }
private void invokeAwareInterfaces(Object bean) { if ( bean instanceof Aware ) { if ( bean instanceof VaadinSecurityAware ) { ((VaadinSecurityAware) bean).setVaadinSecurity(this.applicationContext.getBean(VaadinSecurity.class)); } if ( bean instanceof VaadinSecurityContextAware ) { ((VaadinSecurityContextAware) bean).setVaadinSecurityContext(this.applicationContext.getBean(VaadinSecurityContext.class)); } } }
@Override public boolean isAuthenticatedAnonymously() { final Authentication authentication = getAuthentication(); return authentication instanceof AnonymousAuthenticationToken && authentication.isAuthenticated(); }
/** * {@inheritDoc} */ @Override public boolean hasAuthorities(String... authorities) { for (String authority : authorities) { if (!hasAuthority(authority)) { return false; } } return true; }
private void invokeAwareInterfaces(Object bean) { if ( bean instanceof Aware ) { if ( bean instanceof VaadinSecurityAware ) { ((VaadinSecurityAware) bean).setVaadinSecurity(this.applicationContext.getBean(VaadinSecurity.class)); } if ( bean instanceof VaadinSecurityContextAware ) { ((VaadinSecurityContextAware) bean).setVaadinSecurityContext(this.applicationContext.getBean(VaadinSecurityContext.class)); } } }
@Override public boolean isAuthenticated() { final Authentication authentication = getAuthentication(); return authentication != null && authentication.isAuthenticated() && !(authentication instanceof AnonymousAuthenticationToken); }
@Override public boolean hasAnyAuthority(String... authorities) { for (String authority : authorities) { if (hasAuthority(authority)) { return true; } } return false; }
/** * {@inheritDoc} */ public void login(String username, String password, boolean rememberMe) throws AuthenticationException, Exception { login(new UsernamePasswordAuthenticationToken(username, password), rememberMe); }
/** * {@inheritDoc} */ @Override public boolean hasAnyAuthority(String... authorities) { for (String authority : authorities) { if (hasAuthority(authority)) { return true; } } return false; }
private void invokeAwareInterfaces(Object bean) { if ( bean instanceof Aware ) { if ( bean instanceof VaadinSecurityAware ) { ((VaadinSecurityAware) bean).setVaadinSecurity(this.applicationContext.getBean(VaadinSecurity.class)); } if ( bean instanceof VaadinSecurityContextAware ) { ((VaadinSecurityContextAware) bean).setVaadinSecurityContext(this.applicationContext.getBean(VaadinSecurityContext.class)); } } }
@Override public boolean isAuthenticated() { final Authentication authentication = getAuthentication(); return authentication != null && authentication.isAuthenticated() && !(authentication instanceof AnonymousAuthenticationToken); }
@Override public boolean hasAuthorities(String... authorities) { for (String authority : authorities) { if (!hasAuthority(authority)) { return false; } } return true; }
/** * {@inheritDoc} */ @Override public void login(String username, String password) throws AuthenticationException, Exception { login(new UsernamePasswordAuthenticationToken(username, password)); }
@Override public boolean isAuthenticatedAnonymously() { final Authentication authentication = getAuthentication(); return authentication instanceof AnonymousAuthenticationToken && authentication.isAuthenticated(); }
@Override public boolean hasAnyAuthority(String... authorities) { for (String authority : authorities) { if (hasAuthority(authority)) { return true; } } return false; }
@Override public boolean isRememberMeAuthenticated() { final Authentication authentication = getAuthentication(); return authentication instanceof RememberMeAuthenticationToken && authentication.isAuthenticated(); }
@Override public boolean isRememberMeAuthenticated() { final Authentication authentication = getAuthentication(); return authentication instanceof RememberMeAuthenticationToken && authentication.isAuthenticated(); }
@Override public boolean isFullyAuthenticated() { final Authentication authentication = getAuthentication(); return authentication != null && !(authentication instanceof AnonymousAuthenticationToken) && !(authentication instanceof RememberMeAuthenticationToken) && authentication.isAuthenticated(); }