mirror of
https://github.com/fabioformosa/quartz-manager.git
synced 2026-05-27 20:20:30 +09:00
moved admin credentials into application context
This commit is contained in:
@@ -3,6 +3,7 @@ package it.fabioformosa.quartzmanager.configuration;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
@@ -69,10 +70,17 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
}
|
||||
|
||||
|
||||
@Value("${quartz-manager.account.user}")
|
||||
private String adminUser;
|
||||
|
||||
@Value("${quartz-manager.account.pwd}")
|
||||
private String adminPwd;
|
||||
|
||||
|
||||
@Autowired
|
||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||
PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
||||
auth.inMemoryAuthentication().withUser("admin").password(encoder.encode("admin")).roles("ADMIN");
|
||||
auth.inMemoryAuthentication().withUser(adminUser).password(encoder.encode(adminPwd)).roles("ADMIN");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ server:
|
||||
session.timeout : 28800
|
||||
port: 8080
|
||||
|
||||
app:
|
||||
name: quartz-manager
|
||||
|
||||
spring:
|
||||
thymeleaf:
|
||||
cache: false
|
||||
@@ -16,16 +19,19 @@ job:
|
||||
frequency: 4000
|
||||
repeatCount: 19
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.springframework.web: WARN
|
||||
it.fabioformosa: INFO
|
||||
|
||||
app:
|
||||
name: quartz-manager
|
||||
|
||||
jwt:
|
||||
header: Authorization
|
||||
expires_in: 600 # 10 minutes
|
||||
secret: queenvictoria
|
||||
cookie: AUTH-TOKEN
|
||||
cookie: AUTH-TOKEN
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.springframework.web: WARN
|
||||
it.fabioformosa: INFO
|
||||
|
||||
quartz-manager:
|
||||
account:
|
||||
user: admin
|
||||
pwd: admin
|
||||
|
||||
Reference in New Issue
Block a user