public interface VaadinSecurity extends VaadinSecurityContext
| Modifier and Type | Method and Description |
|---|---|
Authentication |
getAuthentication()
Gets the authentication token of the current user.
|
boolean |
hasAccessToObject(Object securedObject,
String... securityConfigurationAttributes)
Checks if the current user is authorized based on the specified security configuration attributes.
|
boolean |
hasAccessToSecuredMethod(Object securedObject,
String methodName,
Class<?>... methodParameterTypes)
Uses the
Secured annotation on the specified method to check if the current user has access to the secured object. |
boolean |
hasAccessToSecuredObject(Object securedObject)
Convenience method that invokes
hasAccessToObject(Object, String...), using the Secured annotation of the secured object
to get the security configuration attributes. |
boolean |
hasAnyAuthority(String... authorities)
Checks if the current user has at least one of the specified authorities.
|
boolean |
hasAuthorities(String... authorities)
Checks if the current user has all required authorities.
|
boolean |
hasAuthority(String authority)
Checks if the current user has the specified authority.
|
boolean |
isAuthenticated()
Checks if the current user is authenticated.
|
void |
login(Authentication authentication)
Tries to login using the specified authentication object.
|
void |
login(Authentication authentication,
boolean rememberMe)
Tries to login using the specified authentication object.
|
void |
login(String username,
String password)
Convenience method that invokes
login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object. |
void |
login(String username,
String password,
boolean rememberMe)
Convenience method that invokes
login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object. |
void |
logout()
Logs the user out, and have Spring-Security handle the logout with the configured
LogoutConfigurer of the HttpSecurity.
|
void |
setLogoutProcessingUrl(String logoutUrl)
Set the logout processing URL, defaults to '/logout'.
|
void |
setSpringSecurityContextKey(String springSecurityContextKey)
Allows the session attribute name to be customized for this repository instance.
|
addAuthenticationFailureHandler, addAuthenticationSuccessHandler, getAccessDecisionManager, getApplicationContext, getAuthenticationManager, getSessionAuthenticationStrategy, hasAccessDecisionManager, hasAuthenticationFailureHandlerConfigured, hasAuthenticationSuccessHandlerConfiguredboolean isAuthenticated()
SecurityContext contains an Authentication token,
and the token has been authenticated by an AuthenticationManager.Authentication.isAuthenticated()void login(Authentication authentication, boolean rememberMe) throws AuthenticationException, Exception
authentication - the authentication object to authenticate, must not be null.rememberMe - boolean to indicate if remember me authentication should be activatedAuthenticationException - if authentication fails.Exceptionvoid login(Authentication authentication) throws AuthenticationException, Exception
Remember Me authentication is ignored
authentication - the authentication object to authenticate, must not be null.AuthenticationException - if authentication fails.Exceptionvoid login(String username, String password, boolean rememberMe) throws AuthenticationException, Exception
login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object.username - the username to use, must not be null.password - the password to use, must not be null.rememberMe - boolean to set remember me authenticationAuthenticationException - if authentication fails.javax.servlet.ServletException - if Authentication{Success/Failure}Handler failsIOException - if Authentication{Success/Failure}Handler failsExceptionvoid login(String username, String password) throws AuthenticationException, Exception
login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object.
Remember me authentication is ignored
username - the username to use, must not be null.password - the password to use, must not be null.AuthenticationException - if authentication fails.javax.servlet.ServletException - if Authentication{Success/Failure}Handler failsIOException - if Authentication{Success/Failure}Handler failsExceptionvoid setLogoutProcessingUrl(String logoutUrl)
logoutUrl - the use url at which the logout is configured with HttpSecurityvoid logout()
boolean hasAuthority(String authority)
hasAccessToObject(Object, String...).authority - the authority to check, must not be null.SecurityContext contains an authenticated Authentication
token that has a GrantedAuthority whose string representation matches the specified authority.Authentication.getAuthorities(),
GrantedAuthority.getAuthority()Authentication getAuthentication()
Authentication token stored in the current SecurityContext, or null.boolean hasAccessToObject(Object securedObject, String... securityConfigurationAttributes)
Secured annotation).securedObject - the secured object.securityConfigurationAttributes - the security configuration attributes.boolean hasAccessToSecuredObject(Object securedObject)
hasAccessToObject(Object, String...), using the Secured annotation of the secured object
to get the security configuration attributes.securedObject - the secured object, must not be null and must have the Secured annotation.boolean hasAccessToSecuredMethod(Object securedObject, String methodName, Class<?>... methodParameterTypes)
Secured annotation on the specified method to check if the current user has access to the secured object.securedObject - the secured object, must not be null.methodName - the name of the method holding the Secured annotation.methodParameterTypes - the parameter types of the method holding the Secured annotation.hasAccessToSecuredObject(Object)boolean hasAuthorities(String... authorities)
authorities - the required authorities.hasAuthority(String),
hasAnyAuthority(String...)boolean hasAnyAuthority(String... authorities)
authorities - the authorities.hasAuthority(String),
hasAuthorities(String...)void setSpringSecurityContextKey(String springSecurityContextKey)
springSecurityContextKey - the key under which the security context will be stored. Defaults toCopyright © 2015. All rights reserved.