Package io.jmix.securityflowui
Class FlowuiSecurityConfiguration
java.lang.Object
io.jmix.securityflowui.FlowuiSecurityConfiguration
- Direct Known Subclasses:
SecurityFlowuiAutoConfiguration.DefaultFlowuiSecurityConfiguration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected com.vaadin.flow.spring.VaadinConfigurationPropertiesstatic final Stringstatic final Stringprotected com.vaadin.flow.spring.security.RequestUtilstatic final Stringprotected org.springframework.boot.autoconfigure.web.ServerPropertiesprotected UiPropertiesprotected com.vaadin.flow.spring.security.VaadinDefaultRequestCacheprotected UiViewAccessCheckerprotected ViewRegistry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyUrlMapping(String path) Prepends to the givenpathwith the configured url mapping.static StringapplyUrlMapping(String urlMapping, String path) Prepends to the givenpathwith the servlet path prefix from input url mapping.protected voidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) protected org.springframework.security.web.access.AccessDeniedHandlerprotected org.springframework.security.web.util.matcher.RequestMatchercreateLogoutRequestMatcher(String logoutUrl) protected org.springframework.security.web.util.matcher.RequestMatchercreateLogoutRequestMatcher(String logoutUrl, String httpMethod) protected com.vaadin.flow.spring.security.VaadinSavedRequestAwareAuthenticationSuccessHandlercreateSuccessHandler(org.springframework.security.config.annotation.web.builders.HttpSecurity http) static org.springframework.security.web.util.matcher.RequestMatchergetDefaultHttpSecurityPermitMatcher(String urlMapping) Matcher for framework internal requests, with Vaadin servlet mapped on the given path.static org.springframework.security.web.util.matcher.RequestMatchergetDefaultWebSecurityIgnoreMatcher(String urlMapping) Matcher for Vaadin static (public) resources, with Vaadin servlet mapped on the given path.protected voidinitLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http) org.springframework.security.web.SecurityFilterChainsecurityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetConfigurationProperties(com.vaadin.flow.spring.VaadinConfigurationProperties configurationProperties) protected voidsetLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, Class<? extends com.vaadin.flow.component.Component> viewClass) protected voidsetLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, Class<? extends com.vaadin.flow.component.Component> loginViewClass, String logoutUrl) protected voidsetLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, String viewId) protected voidsetLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, String viewId, String logoutUrl) voidsetRequestUtil(com.vaadin.flow.spring.security.RequestUtil requestUtil) voidsetServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties serverProperties) voidsetUiProperties(UiProperties uiProperties) voidsetVaadinDefaultRequestCache(com.vaadin.flow.spring.security.VaadinDefaultRequestCache vaadinDefaultRequestCache) voidsetViewAccessChecker(UiViewAccessChecker viewAccessChecker) voidsetViewRegistry(ViewRegistry viewRegistry) org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizerThe paths listed as "ignoring" in this method are handled without any Spring Security involvement.
-
Field Details
-
LOGOUT_URL
- See Also:
-
LOGOUT_SUCCESS_URL
- See Also:
-
SECURITY_CONFIGURER_QUALIFIER
- See Also:
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
vaadinDefaultRequestCache
protected com.vaadin.flow.spring.security.VaadinDefaultRequestCache vaadinDefaultRequestCache -
configurationProperties
protected com.vaadin.flow.spring.VaadinConfigurationProperties configurationProperties -
requestUtil
protected com.vaadin.flow.spring.security.RequestUtil requestUtil -
viewAccessChecker
-
uiProperties
-
viewRegistry
-
serverProperties
protected org.springframework.boot.autoconfigure.web.ServerProperties serverProperties
-
-
Constructor Details
-
FlowuiSecurityConfiguration
public FlowuiSecurityConfiguration()
-
-
Method Details
-
setApplicationContext
@Autowired public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) -
setVaadinDefaultRequestCache
@Autowired public void setVaadinDefaultRequestCache(com.vaadin.flow.spring.security.VaadinDefaultRequestCache vaadinDefaultRequestCache) -
setConfigurationProperties
@Autowired public void setConfigurationProperties(com.vaadin.flow.spring.VaadinConfigurationProperties configurationProperties) -
setRequestUtil
@Autowired public void setRequestUtil(com.vaadin.flow.spring.security.RequestUtil requestUtil) -
setViewAccessChecker
-
setUiProperties
-
setViewRegistry
-
setServerProperties
@Autowired public void setServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties serverProperties) -
webSecurityCustomizer
@Bean public org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer webSecurityCustomizer()The paths listed as "ignoring" in this method are handled without any Spring Security involvement. They have no access to any security context etc. -
securityFilterChain
@Bean("sec_UiSecurityFilterChain") @Order(400) public org.springframework.security.web.SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception - Throws:
Exception
-
configure
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception - Throws:
Exception
-
initLoginView
protected void initLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception - Throws:
Exception
-
getDefaultHttpSecurityPermitMatcher
public static org.springframework.security.web.util.matcher.RequestMatcher getDefaultHttpSecurityPermitMatcher(String urlMapping) Matcher for framework internal requests, with Vaadin servlet mapped on the given path.- Parameters:
urlMapping- url mapping for the Vaadin servlet.- Returns:
- default
HttpSecuritybypass matcher
-
getDefaultWebSecurityIgnoreMatcher
public static org.springframework.security.web.util.matcher.RequestMatcher getDefaultWebSecurityIgnoreMatcher(String urlMapping) Matcher for Vaadin static (public) resources, with Vaadin servlet mapped on the given path.Assumes Vaadin servlet to be mapped on root path (/*).
- Parameters:
urlMapping- the url mapping for the Vaadin servlet- Returns:
- default
WebSecurityignore matcher
-
setLoginView
protected void setLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, String viewId) throws Exception - Throws:
Exception
-
setLoginView
protected void setLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, String viewId, String logoutUrl) throws Exception - Throws:
Exception
-
setLoginView
protected void setLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, Class<? extends com.vaadin.flow.component.Component> viewClass) throws Exception - Throws:
Exception
-
setLoginView
protected void setLoginView(org.springframework.security.config.annotation.web.builders.HttpSecurity http, Class<? extends com.vaadin.flow.component.Component> loginViewClass, String logoutUrl) throws Exception - Throws:
Exception
-
createLogoutRequestMatcher
protected org.springframework.security.web.util.matcher.RequestMatcher createLogoutRequestMatcher(String logoutUrl) -
createLogoutRequestMatcher
-
createSuccessHandler
protected com.vaadin.flow.spring.security.VaadinSavedRequestAwareAuthenticationSuccessHandler createSuccessHandler(org.springframework.security.config.annotation.web.builders.HttpSecurity http) -
createAccessDeniedHandler
protected org.springframework.security.web.access.AccessDeniedHandler createAccessDeniedHandler() -
getUrlMapping
-
applyUrlMapping
Prepends to the givenpathwith the configured url mapping.A
nullpath is treated as empty string; the same applies for url mapping.- Parameters:
path- a path- Returns:
- the path with prepended url mapping.
- See Also:
-
VaadinConfigurationProperties.getUrlMapping()
-
applyUrlMapping
Prepends to the givenpathwith the servlet path prefix from input url mapping.A
nullpath is treated as empty string; the same applies for url mapping.- Parameters:
path- a pathurlMapping- url mapping- Returns:
- the path with prepended url mapping.
- See Also:
-
VaadinConfigurationProperties.getUrlMapping()
-