title: How to dynamically change client_secret in Spring Security with Spring boot
body: <p>Now I have this configuration:</p>
  <pre><code>spring:
    security:
      oauth2:
        client:
          registration:
            sbbol:
              client-id: zdcffffff
              client-secret: ffffffffff
              scope:
                - openid
              client-authentication-method: post
              authorization-grant-type: authorization_code
              redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}'
              client-authentication-scheme: form
          provider:
            sbbol:
              authorization-uri: ${SBBOL_AUTH_URI}
              token-uri: ${SBBOL_AUTH_URI}
              user-info-uri: ${SBBOL_AUTH_URI}
              user-name-attribute: sub
  </code></pre>
  <pre><code>@Configuration
  public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http.httpBasic().disable();
          http.cors().disable();
          http.csrf().disable();
          http.requestMatchers()
              .antMatchers(&quot;/login&quot;, &quot;/oauth2/authorization/sbbol&quot;, &quot;/login/oauth2/code/sbbol&quot;)
              .and()
              .authorizeRequests().anyRequest().authenticated();
          http.oauth2Login()
              .defaultSuccessUrl(&quot;/user&quot;)
              .permitAll();
      }
  }
  </code></pre>
  <p>this works, but my provider asks me to change the client-secret every 30 days via a rest api call. I have a question, how do I set the new client-secret in Spring Security? Maybe I can store the configuration in the database?</p>