title: JWE in Spring Security OAuth2 JWT
body: <p>Is it possible to use JSON Web Encryption(JWE) with Spring Security OAuth2 JWT ?</p>
  
  <p>Right now I have a following <code>JwtAccessTokenConverter</code>:</p>
  
  <pre><code>@Bean
  public JwtAccessTokenConverter accessTokenConverter() {
      JwtAccessTokenConverter converter = new JwtAccessTokenConverter() {
  
          @Override
          public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
              DBUserDetails user = (DBUserDetails) authentication.getUserAuthentication().getPrincipal();
              final Map&lt;String, Object&gt; additionalInfo = new HashMap&lt;&gt;();
              additionalInfo.put("user_id", user.getUser().getId());
              ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
              OAuth2AccessToken enhancedToken = super.enhance(accessToken, authentication);
              return enhancedToken;
          }
  
      };
  
      converter.setSigningKey(jwtAccessTokenConverterSigningKey);
  
      DefaultAccessTokenConverter accessTokenConverter = new DefaultAccessTokenConverter();
      DefaultUserAuthenticationConverter userTokenConverter = new DefaultUserAuthenticationConverter();
      userTokenConverter.setUserDetailsService(userDetailsService);
      accessTokenConverter.setUserTokenConverter(userTokenConverter);
  
      converter.setAccessTokenConverter(accessTokenConverter);
  
      return converter;
  }
  </code></pre>
  
  <p>How to add JWE support here ?</p>