diff --git a/pom.xml b/pom.xml
index f3cc660..3010232 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,17 +4,17 @@
4.0.0
com.gabrielczar
- spring-rest-oauth2-jwt
+ spring-2-oauth2-jwt
0.0.1-SNAPSHOT
jar
- spring-rest-oauth2-jwt
+ spring-2-oauth2-jwt
Demo project for Spring Boot
org.springframework.boot
spring-boot-starter-parent
- 1.5.13.RELEASE
+ 2.0.2.RELEASE
@@ -22,63 +22,41 @@
UTF-8
UTF-8
1.8
-
- Edgware.SR3
-
- frolvlad/alpine-oraclejdk8:slim
- 8080
- 127.0.0.1
- readme
+ Finchley.BUILD-SNAPSHOT
-
org.springframework.boot
- spring-boot-starter-web
+ spring-boot-starter-actuator
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
-
-
org.springframework.boot
spring-boot-starter-security
- org.springframework.security
- spring-security-jwt
- 1.0.9.RELEASE
+ org.springframework.boot
+ spring-boot-starter-web
-
org.springframework.cloud
spring-cloud-starter-oauth2
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
com.h2database
h2
runtime
-
-
org.projectlombok
lombok
true
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
-
org.springframework.boot
spring-boot-starter-test
@@ -109,41 +87,27 @@
org.springframework.boot
spring-boot-maven-plugin
-
-
- io.fabric8
- docker-maven-plugin
- 0.26.0
- true
-
-
-
- spring-rest-oauth2-jwt
- spring-rest-oauth2-jwt
-
- @
- ${project.basedir}/src/main/docker
-
- artifact
-
-
-
- alias
-
- ${tomcat.port}:8080
-
-
-
- http://${tomcat.ip}:${tomcat.port}/health
-
-
-
-
-
-
-
-
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+ false
+
+
+
+
+
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
deleted file mode 100644
index 7f2f891..0000000
--- a/src/main/docker/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM frolvlad/alpine-oraclejdk8:slim
-ADD maven/spring-rest-oauth2-jwt-0.0.1-SNAPSHOT.jar app.jar
-ENV JAVA_OPTS=""
-ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
\ No newline at end of file
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/SpringRestOauth2JwtApplication.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/Spring2Oauth2JwtApplication.java
similarity index 54%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/SpringRestOauth2JwtApplication.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/Spring2Oauth2JwtApplication.java
index a7fc03c..73d4b53 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/SpringRestOauth2JwtApplication.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/Spring2Oauth2JwtApplication.java
@@ -1,11 +1,12 @@
-package com.gabrielczar.springrestoauth2jwt;
+package com.gabrielczar.spring2oauth2jwt;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
-public class SpringRestOauth2JwtApplication {
+public class Spring2Oauth2JwtApplication {
+
public static void main(String[] args) {
- SpringApplication.run(SpringRestOauth2JwtApplication.class, args);
+ SpringApplication.run(Spring2Oauth2JwtApplication.class, args);
}
}
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/bootstrap/DevBootstrap.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/bootstrap/DevBootstrap.java
similarity index 80%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/bootstrap/DevBootstrap.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/bootstrap/DevBootstrap.java
index 0898284..e26aa01 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/bootstrap/DevBootstrap.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/bootstrap/DevBootstrap.java
@@ -1,10 +1,9 @@
-package com.gabrielczar.springrestoauth2jwt.bootstrap;
+package com.gabrielczar.spring2oauth2jwt.bootstrap;
-import com.gabrielczar.springrestoauth2jwt.domain.Authority;
-import com.gabrielczar.springrestoauth2jwt.domain.User;
-import com.gabrielczar.springrestoauth2jwt.repositories.UserRepository;
-import org.apache.log4j.Logger;
+import com.gabrielczar.spring2oauth2jwt.entities.Authority;
+import com.gabrielczar.spring2oauth2jwt.entities.User;
+import com.gabrielczar.spring2oauth2jwt.repositories.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
@@ -12,6 +11,7 @@
import java.util.Arrays;
import java.util.Collections;
+import java.util.logging.Logger;
@Component
public class DevBootstrap implements ApplicationListener {
@@ -44,6 +44,6 @@ public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
user.setPassword("123456");
user.setAuthorities(Collections.singletonList(new Authority("ROLE_USER")));
- userRepository.save(Arrays.asList(adm, user));
+ userRepository.saveAll(Arrays.asList(adm, user));
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/controllers/UserController.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/controllers/UserController.java
similarity index 86%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/controllers/UserController.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/controllers/UserController.java
index 51e2423..52fe72c 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/controllers/UserController.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/controllers/UserController.java
@@ -1,7 +1,8 @@
-package com.gabrielczar.springrestoauth2jwt.controllers;
+package com.gabrielczar.spring2oauth2jwt.controllers;
-import com.gabrielczar.springrestoauth2jwt.domain.User;
-import com.gabrielczar.springrestoauth2jwt.repositories.UserRepository;
+
+import com.gabrielczar.spring2oauth2jwt.entities.User;
+import com.gabrielczar.spring2oauth2jwt.repositories.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/domain/Authority.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/entities/Authority.java
similarity index 92%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/domain/Authority.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/entities/Authority.java
index 5d8cffb..943ed0e 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/domain/Authority.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/entities/Authority.java
@@ -1,4 +1,4 @@
-package com.gabrielczar.springrestoauth2jwt.domain;
+package com.gabrielczar.spring2oauth2jwt.entities;
import lombok.Data;
import lombok.NoArgsConstructor;
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/domain/User.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/entities/User.java
similarity index 88%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/domain/User.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/entities/User.java
index eee3aa5..384461e 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/domain/User.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/entities/User.java
@@ -1,8 +1,8 @@
-package com.gabrielczar.springrestoauth2jwt.domain;
+package com.gabrielczar.spring2oauth2jwt.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.gabrielczar.springrestoauth2jwt.handlers.UserListenerHandler;
+import com.gabrielczar.spring2oauth2jwt.handlers.UserListenerHandler;
import lombok.Data;
import lombok.ToString;
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/handlers/UserListenerHandler.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/handlers/UserListenerHandler.java
similarity index 84%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/handlers/UserListenerHandler.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/handlers/UserListenerHandler.java
index ec3beb1..ce45914 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/handlers/UserListenerHandler.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/handlers/UserListenerHandler.java
@@ -1,6 +1,6 @@
-package com.gabrielczar.springrestoauth2jwt.handlers;
+package com.gabrielczar.spring2oauth2jwt.handlers;
-import com.gabrielczar.springrestoauth2jwt.domain.User;
+import com.gabrielczar.spring2oauth2jwt.entities.User;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Component;
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/repositories/UserRepository.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/repositories/UserRepository.java
similarity index 70%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/repositories/UserRepository.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/repositories/UserRepository.java
index 878459e..046368f 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/repositories/UserRepository.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/repositories/UserRepository.java
@@ -1,6 +1,7 @@
-package com.gabrielczar.springrestoauth2jwt.repositories;
+package com.gabrielczar.spring2oauth2jwt.repositories;
-import com.gabrielczar.springrestoauth2jwt.domain.User;
+
+import com.gabrielczar.spring2oauth2jwt.entities.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/OAuth2ServerConfiguration.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/OAuth2ServerConfiguration.java
similarity index 96%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/OAuth2ServerConfiguration.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/security/OAuth2ServerConfiguration.java
index a1c46cd..e5a337e 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/OAuth2ServerConfiguration.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/OAuth2ServerConfiguration.java
@@ -1,7 +1,6 @@
-package com.gabrielczar.springrestoauth2jwt.configurations;
+package com.gabrielczar.spring2oauth2jwt.security;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -18,7 +17,6 @@
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore;
-import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
@@ -62,8 +60,8 @@ public void configure(HttpSecurity http) throws Exception {
.invalidateHttpSession(true)
.clearAuthentication(true)
.and().authorizeRequests()
- .antMatchers("/api/**").hasAnyRole("ADMIN", "USER")
.antMatchers("/api/public/**").permitAll()
+ .antMatchers("/api/**").hasAnyRole("ADMIN", "USER")
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.anyRequest().denyAll();
}
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/RestAuthenticationEntryPoint.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/RestAuthenticationEntryPoint.java
similarity index 91%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/RestAuthenticationEntryPoint.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/security/RestAuthenticationEntryPoint.java
index fea8418..4b227ac 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/RestAuthenticationEntryPoint.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/RestAuthenticationEntryPoint.java
@@ -1,4 +1,4 @@
-package com.gabrielczar.springrestoauth2jwt.configurations;
+package com.gabrielczar.spring2oauth2jwt.security;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/SecurityConfiguration.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/SecurityConfiguration.java
similarity index 89%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/SecurityConfiguration.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/security/SecurityConfiguration.java
index 1bc887e..e6f4af1 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/SecurityConfiguration.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/SecurityConfiguration.java
@@ -1,10 +1,13 @@
-package com.gabrielczar.springrestoauth2jwt.configurations;
+package com.gabrielczar.spring2oauth2jwt.security;
+
+import com.gabrielczar.spring2oauth2jwt.services.ImplUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.config.BeanIds;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@@ -13,6 +16,7 @@
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.csrf.CsrfFilter;
@@ -33,13 +37,8 @@ public SecurityConfiguration(RestAuthenticationEntryPoint restAuthenticationEntr
this.userDetailsService = userDetailsService;
}
- @Bean
- public PasswordEncoder passwordEncoder() {
- return new BCryptPasswordEncoder();
- }
-
- @Bean
@Override
+ @Bean(name = BeanIds.AUTHENTICATION_MANAGER)
protected AuthenticationManager authenticationManager() throws Exception {
// provides the default AuthenticationManager as a Bean
return super.authenticationManager();
@@ -47,7 +46,7 @@ protected AuthenticationManager authenticationManager() throws Exception {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
- auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
+ auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder());
}
@Override
@@ -60,4 +59,4 @@ protected void configure(HttpSecurity http) throws Exception {
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/StatelessCsrfFilter.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/StatelessCsrfFilter.java
similarity index 87%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/StatelessCsrfFilter.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/security/StatelessCsrfFilter.java
index 8dc3b92..9e473da 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/configurations/StatelessCsrfFilter.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/security/StatelessCsrfFilter.java
@@ -1,4 +1,4 @@
-package com.gabrielczar.springrestoauth2jwt.configurations;
+package com.gabrielczar.spring2oauth2jwt.security;
import org.springframework.security.access.AccessDeniedException;
@@ -15,7 +15,9 @@
import java.util.Arrays;
import java.util.Optional;
-import static com.gabrielczar.springrestoauth2jwt.utils.Constants.*;
+import static com.gabrielczar.spring2oauth2jwt.utils.Constants.CSRF_COOKIE;
+import static com.gabrielczar.spring2oauth2jwt.utils.Constants.CSRF_HEADER;
+import static com.gabrielczar.spring2oauth2jwt.utils.Constants.SAFE_METHODS;
public class StatelessCsrfFilter extends OncePerRequestFilter {
private final AccessDeniedHandler accessDeniedHandler = new AccessDeniedHandlerImpl();
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/services/ImplUserDetailService.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/services/ImplUserDetailsService.java
similarity index 76%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/services/ImplUserDetailService.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/services/ImplUserDetailsService.java
index 261ac5d..35169df 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/services/ImplUserDetailService.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/services/ImplUserDetailsService.java
@@ -1,8 +1,10 @@
-package com.gabrielczar.springrestoauth2jwt.services;
+package com.gabrielczar.spring2oauth2jwt.services;
-import com.gabrielczar.springrestoauth2jwt.domain.User;
-import com.gabrielczar.springrestoauth2jwt.repositories.UserRepository;
+
+import com.gabrielczar.spring2oauth2jwt.entities.User;
+import com.gabrielczar.spring2oauth2jwt.repositories.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
@@ -11,13 +13,14 @@
import java.util.logging.Logger;
@Service
-public class ImplUserDetailService implements UserDetailsService {
+@Primary
+public class ImplUserDetailsService implements UserDetailsService {
private final Logger LOGGER = Logger.getLogger(this.getClass().getName());
private final UserRepository userRepository;
@Autowired
- public ImplUserDetailService(UserRepository userRepository) {
+ public ImplUserDetailsService(UserRepository userRepository) {
this.userRepository = userRepository;
}
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/utils/Constants.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/utils/Constants.java
similarity index 86%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/utils/Constants.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/utils/Constants.java
index befbcdf..2e2ada9 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/utils/Constants.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/utils/Constants.java
@@ -1,4 +1,5 @@
-package com.gabrielczar.springrestoauth2jwt.utils;
+package com.gabrielczar.spring2oauth2jwt.utils;
+
import java.util.Arrays;
import java.util.HashSet;
@@ -10,4 +11,4 @@ public class Constants {
public static final String CSRF_COOKIE = "CSRF-TOKEN";
public static final String CSRF_HEADER = "X-CSRF-TOKEN";
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/utils/LocalDateAttributeConverter.java b/src/main/java/com/gabrielczar/spring2oauth2jwt/utils/LocalDateAttributeConverter.java
similarity index 91%
rename from src/main/java/com/gabrielczar/springrestoauth2jwt/utils/LocalDateAttributeConverter.java
rename to src/main/java/com/gabrielczar/spring2oauth2jwt/utils/LocalDateAttributeConverter.java
index a0de68d..4c5ae53 100644
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/utils/LocalDateAttributeConverter.java
+++ b/src/main/java/com/gabrielczar/spring2oauth2jwt/utils/LocalDateAttributeConverter.java
@@ -1,4 +1,5 @@
-package com.gabrielczar.springrestoauth2jwt.utils;
+package com.gabrielczar.spring2oauth2jwt.utils;
+
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
@@ -18,4 +19,4 @@ public LocalDate convertToEntityAttribute(Date sqlDate) {
return (sqlDate == null ? null : sqlDate.toLocalDate());
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/com/gabrielczar/springrestoauth2jwt/controllers/ErrorRestController.java b/src/main/java/com/gabrielczar/springrestoauth2jwt/controllers/ErrorRestController.java
deleted file mode 100644
index 457b6db..0000000
--- a/src/main/java/com/gabrielczar/springrestoauth2jwt/controllers/ErrorRestController.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.gabrielczar.springrestoauth2jwt.controllers;
-
-import org.springframework.boot.autoconfigure.web.ErrorController;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class ErrorRestController implements ErrorController {
-
- private static final String PATH = "/error";
-
- @RequestMapping(value = PATH, produces = "application/json")
- public ResponseEntity error() {
- return ResponseEntity.badRequest().body("{ \"error\": \"This content doesn't exist or is unauthorized!\"}");
- }
-
- @Override
- public String getErrorPath() {
- return PATH;
- }
-
-}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index a696289..44fbbd6 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -7,7 +7,7 @@ security:
resource.id: DA2D532D1BEjwtresourceid
client:
client-id: spring-rest-oauth2-jwt
- client-secret: B6813193F1D7EC8BF5B40
+ client-secret: "{noop}B6813193F1D7EC8BF5B40"
access-token-validity-seconds: 604800
refresh-token-validity-seconds: 864000
authorization:
@@ -15,11 +15,12 @@ security:
resource:
jwt:
signing-key: mw5BG4UXKAZKznRbRd3tHXf7hfjKfPY1
- filter-order: 3
-endpoints:
- cors:
- max-age: 3600
- allowed-headers: Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding, Accept-Language, Host, Referer, Connection, AccountCredentialsModel-Agent, Authorization
- allowed-methods: GET, POST, DELETE, PUT, OPTIONS
- allowed-origins: "*"
+management:
+ endpoints:
+ web:
+ cors:
+ max-age: 3600s
+ allowed-origins: "*"
+ allowed-headers: Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding, Accept-Language, Host, Referer, Connection, AccountCredentialsModel-Agent, Authorization
+ allowed-methods: GET, POST, DELETE, PUT, OPTIONS
diff --git a/src/test/java/com/gabrielczar/springrestoauth2jwt/SpringRestOauth2JwtApplicationTests.java b/src/test/java/com/gabrielczar/spring2oauth2jwt/Spring2Oauth2JwtApplicationTests.java
similarity index 74%
rename from src/test/java/com/gabrielczar/springrestoauth2jwt/SpringRestOauth2JwtApplicationTests.java
rename to src/test/java/com/gabrielczar/spring2oauth2jwt/Spring2Oauth2JwtApplicationTests.java
index 97f5122..d6daec5 100644
--- a/src/test/java/com/gabrielczar/springrestoauth2jwt/SpringRestOauth2JwtApplicationTests.java
+++ b/src/test/java/com/gabrielczar/spring2oauth2jwt/Spring2Oauth2JwtApplicationTests.java
@@ -1,4 +1,4 @@
-package com.gabrielczar.springrestoauth2jwt;
+package com.gabrielczar.spring2oauth2jwt;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -7,7 +7,7 @@
@RunWith(SpringRunner.class)
@SpringBootTest
-public class SpringRestOauth2JwtApplicationTests {
+public class Spring2Oauth2JwtApplicationTests {
@Test
public void contextLoads() {