Class IdentityManagementConfiguration

java.lang.Object
com.vaadin.flow.spring.security.VaadinWebSecurity
com.vaadin.controlcenter.starter.idm.IdentityManagementConfiguration

@AutoConfiguration @EnableWebSecurity @ConditionalOnCloudPlatform(KUBERNETES) @ConditionalOnMissingBean(IdentityManagementConfiguration.class) @EnableConfigurationProperties(IdentityManagementProperties.class) public class IdentityManagementConfiguration extends com.vaadin.flow.spring.security.VaadinWebSecurity
This configuration bean is provided to autoconfigure the security to allow single sign-on against identity provider used in Control Center.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
     
    org.springframework.security.web.SecurityFilterChain
    filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
     
    com.vaadin.flow.spring.security.AuthenticationContext
     
    protected void
    ignoreInternalRequests(org.springframework.security.config.annotation.web.configurers.CsrfConfigurer<org.springframework.security.config.annotation.web.builders.HttpSecurity> csrf)
     
    static Collection<? extends org.springframework.security.core.GrantedAuthority>
    mapAuthorities(org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest userRequest, org.springframework.security.oauth2.core.oidc.OidcUserInfo userInfo)
    Maps authorities from OidcUserRequest and OidcUserInfo to a collection of GrantedAuthority that includes Keycloak's realm and client roles.
    protected void
    requestWhitelist(org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer<org.springframework.security.config.annotation.web.builders.HttpSecurity>.org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry urlRegistry)
     
    org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer
     
    protected void
    withIdentityManagementDisabled(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
     
    protected void
    withIdentityManagementEnabled(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
     

    Methods inherited from class com.vaadin.flow.spring.security.VaadinWebSecurity

    addLogoutHandlers, antMatchers, applyUrlMapping, configure, enableNavigationAccessControl, getDefaultHttpSecurityPermitMatcher, getDefaultHttpSecurityPermitMatcher, getDefaultWebSecurityIgnoreMatcher, getDefaultWebSecurityIgnoreMatcher, getNavigationAccessControl, getViewAccessChecker, oidcLogoutSuccessHandler, pathMatchers, routeMatchers, routePathMatchers, setLoginView, setLoginView, setLoginView, setLoginView, setOAuth2LoginPage, setOAuth2LoginPage, setStatelessAuthentication, setStatelessAuthentication

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IdentityManagementConfiguration

      public IdentityManagementConfiguration()
  • Method Details

    • filterChain

      @Bean(name="VaadinSecurityFilterChainBean") @ConditionalOnMissingBean(name="VaadinSecurityFilterChainBean") @RefreshScope public org.springframework.security.web.SecurityFilterChain filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Overrides:
      filterChain in class com.vaadin.flow.spring.security.VaadinWebSecurity
      Throws:
      Exception
    • webSecurityCustomizer

      @Bean(name="VaadinWebSecurityCustomizerBean") @ConditionalOnMissingBean(name="VaadinWebSecurityCustomizerBean") @RefreshScope public org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer webSecurityCustomizer()
      Overrides:
      webSecurityCustomizer in class com.vaadin.flow.spring.security.VaadinWebSecurity
    • getAuthenticationContext

      @Bean(name="VaadinAuthenticationContext") @ConditionalOnMissingBean(name="VaadinAuthenticationContext") @RefreshScope public com.vaadin.flow.spring.security.AuthenticationContext getAuthenticationContext()
      Overrides:
      getAuthenticationContext in class com.vaadin.flow.spring.security.VaadinWebSecurity
    • configure

      protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Overrides:
      configure in class com.vaadin.flow.spring.security.VaadinWebSecurity
      Throws:
      Exception
    • withIdentityManagementEnabled

      protected void withIdentityManagementEnabled(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Throws:
      Exception
    • withIdentityManagementDisabled

      protected void withIdentityManagementDisabled(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Throws:
      Exception
    • requestWhitelist

      protected void requestWhitelist(org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer<org.springframework.security.config.annotation.web.builders.HttpSecurity>.org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry urlRegistry)
    • ignoreInternalRequests

      protected void ignoreInternalRequests(org.springframework.security.config.annotation.web.configurers.CsrfConfigurer<org.springframework.security.config.annotation.web.builders.HttpSecurity> csrf)
    • mapAuthorities

      public static Collection<? extends org.springframework.security.core.GrantedAuthority> mapAuthorities(org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest userRequest, org.springframework.security.oauth2.core.oidc.OidcUserInfo userInfo)
      Maps authorities from OidcUserRequest and OidcUserInfo to a collection of GrantedAuthority that includes Keycloak's realm and client roles.
      Parameters:
      userRequest - the request containing the ID token and access token
      userInfo - the user info containing the user attributes
      Returns:
      a collection of GrantedAuthority