title: Heroku deployment error "required a bean of type 'org.springframework.security.oauth2.jwt.JwtDecoder' that could not be found."
body: <p>I am trying to deploy my springboot app to heroku but I am getting an error that it cannot find a JwtDecoder bean. I have tried googling it a bit but can't find anything that helps. Everything works fine locally, just not when deployed to heroku.</p>
  <p>Here is my heroku log --tail:</p>
  <pre><code>2021-02-27T20:18:45.134160+00:00 app[web.1]: ***************************
  2021-02-27T20:18:45.134160+00:00 app[web.1]: APPLICATION FAILED TO START
  2021-02-27T20:18:45.134160+00:00 app[web.1]: ***************************
  2021-02-27T20:18:45.134161+00:00 app[web.1]:
  2021-02-27T20:18:45.134161+00:00 app[web.1]: Description:
  2021-02-27T20:18:45.134161+00:00 app[web.1]:
  2021-02-27T20:18:45.134179+00:00 app[web.1]: Method springSecurityFilterChain in
  org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration 
  required a bean of type 'org.springframework.security.oauth2.jwt.JwtDecoder' that 
  could not be found.
  2021-02-27T20:18:45.134179+00:00 app[web.1]: 
  2021-02-27T20:18:45.134179+00:00 app[web.1]:
  2021-02-27T20:18:45.134180+00:00 app[web.1]: Action:
  2021-02-27T20:18:45.134180+00:00 app[web.1]:
  2021-02-27T20:18:45.134181+00:00 app[web.1]: Consider defining a bean of type 
  'org.springframework.security.oauth2.jwt.JwtDecoder' in your configuration.
  </code></pre>
  <p>WebSecurityConfig:</p>
  <pre><code>@Configuration
  @EnableWebSecurity
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception{
          http.csrf().disable().cors().configurationSource(corsConfigurationSource())
                  .and()
                  .authorizeRequests()
                  .antMatchers(&quot;/*&quot;)
                  .authenticated()
                  .and()
                  .oauth2ResourceServer()
                  .jwt();
      }
  
  </code></pre>
  <p>I'm not sure what else to include... Feel free to comment on what else I should add. Or, the repo is at <a href="https://github.com/AndreTheTallGuy/Kelp2" rel="nofollow noreferrer">https://github.com/AndreTheTallGuy/Kelp2</a></p>
  <p>Thank you in advance for any help you may be able to provide!</p>