package io.loli.box.oauth2;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;

@Configuration
public class ResourceServer extends ResourceServerConfigurerAdapter {

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.antMatcher("/image/oauthUpload")
                .authorizeRequests().anyRequest().access("#oauth2.hasScope('write')");
    }

    @Override
    public void configure(ResourceServerSecurityConfigurer resources)
            throws Exception {

        resources.resourceId("lolibox");
    }

}
@@ -22,16 +22,79 @@
 auth2;%0A%0A
+import org.springframework.beans.factory.annotation.Autowired;%0A
 import o
@@ -227,16 +227,117 @@
 curity;%0A
+import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;%0A
 import o
@@ -555,23 +555,115 @@
 er;%0A
-%0A@Configuration
+import org.springframework.security.oauth2.provider.token.TokenStore;%0A%0A@Configuration%0A@EnableResourceServer
 %0Apub
@@ -948,16 +948,67 @@
 %0A    %7D%0A%0A
+    @Autowired%0A    private TokenStore tokenStore;%0A%0A
     @Ove
@@ -1114,17 +1114,16 @@
 ption %7B%0A
-%0A
         
@@ -1136,28 +1136,29 @@
 ces.
-resourceId(%22lolibox%22
+tokenStore(tokenStore
 );%0A 

Add missing configuration