File tree 4 files changed +33
-5
lines changed
java/com/appsdeveloperblog/app/ws/security 4 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 121
121
<scope >provided</scope >
122
122
</dependency >
123
123
124
+ <!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
125
+ <dependency >
126
+ <groupId >com.h2database</groupId >
127
+ <artifactId >h2</artifactId >
128
+ <scope >runtime</scope >
129
+ </dependency >
130
+
124
131
</dependencies >
125
132
126
133
<build >
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public class SecurityConstants {
15
15
"/users/password-reset-request" ;
16
16
public static final String PASSWORD_RESET_URL =
17
17
"/users/password-reset" ;
18
+ public static final String H2_CONSOLE = "/h2-console/**" ;
18
19
19
20
public static String getTokenSecret () {
20
21
AppProperties appProperties = (AppProperties ) SpringApplicationContext .getBean (
Original file line number Diff line number Diff line change @@ -37,13 +37,18 @@ protected void configure(HttpSecurity http) throws Exception {
37
37
.permitAll ()
38
38
.antMatchers (HttpMethod .POST , SecurityConstants .PASSWORD_RESET_URL )
39
39
.permitAll ()
40
+ .antMatchers (SecurityConstants .H2_CONSOLE )
41
+ .permitAll ()
40
42
.anyRequest ()
41
43
.authenticated ()
42
44
.and ()
43
45
.addFilter (getAuthenticationFilter ())
44
46
.addFilter (new AuthorizationFilter (authenticationManager ()))
45
47
.sessionManagement ()
46
48
.sessionCreationPolicy (SessionCreationPolicy .STATELESS );
49
+
50
+ // H2 console configuration only for development not for production
51
+ http .headers ().frameOptions ().disable ();
47
52
}
48
53
49
54
@ Override
Original file line number Diff line number Diff line change
1
+ #Spring properties
1
2
server.error.whitelabel.enabled=false
2
- spring.datasource.username=
3
- spring.datasource.password=
4
- spring.datasource.url=jdbc:mysql://127.0.0.1:3306/photo_app
5
- spring.jpa.hibernate.ddl-auto=update
6
- tokenSecret=tokenSecret
7
3
server.error.include-stacktrace=never
8
4
server.servlet.context-path=/mobile-app-ws
9
5
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL8Dialect
6
+ tokenSecret=tokenSecret
7
+
8
+ #spring.datasource.username=
9
+ #spring.datasource.password=
10
+ spring.jpa.hibernate.ddl-auto=update
11
+
12
+ #H2 database
13
+ server.port=8888
14
+ spring.h2.console.enabled=true
15
+ spring.h2.console.path=/h2-console
16
+
17
+ #MySQL database
18
+ #server.port=8080
19
+ #spring.datasource.url=jdbc:mysql://127.0.0.1:3306/photo_app
20
+
21
+ #AWS RDS database
22
+ #spring.datasource.url=
23
+
24
+ #AWS SES email service
10
25
aws.accessKeyId=
11
26
aws.secretKey=
You can’t perform that action at this time.
0 commit comments