|
1
|
|
|
package unicon.matthews.security.config; |
|
2
|
|
|
|
|
3
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
4
|
|
|
import org.springframework.context.annotation.Configuration; |
|
5
|
|
|
|
|
6
|
|
|
import unicon.matthews.security.model.token.JwtToken; |
|
7
|
|
|
|
|
8
|
|
|
@Configuration |
|
9
|
|
|
@ConfigurationProperties(prefix = "matthews.security.jwt") |
|
10
|
|
|
public class JwtSettings { |
|
11
|
|
|
/** |
|
12
|
|
|
* {@link JwtToken} will expire after this time. |
|
13
|
|
|
*/ |
|
14
|
|
|
private Integer tokenExpirationTime; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Token issuer. |
|
18
|
|
|
*/ |
|
19
|
|
|
private String tokenIssuer; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Key is used to sign {@link JwtToken}. |
|
23
|
|
|
*/ |
|
24
|
|
|
private String tokenSigningKey; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* {@link JwtToken} can be refreshed during this timeframe. |
|
28
|
|
|
*/ |
|
29
|
|
|
private Integer refreshTokenExpTime; |
|
30
|
|
|
|
|
31
|
|
|
public Integer getRefreshTokenExpTime() { |
|
32
|
|
|
return refreshTokenExpTime; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public void setRefreshTokenExpTime(Integer refreshTokenExpTime) { |
|
36
|
|
|
this.refreshTokenExpTime = refreshTokenExpTime; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
public Integer getTokenExpirationTime() { |
|
40
|
|
|
return tokenExpirationTime; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public void setTokenExpirationTime(Integer tokenExpirationTime) { |
|
44
|
|
|
this.tokenExpirationTime = tokenExpirationTime; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public String getTokenIssuer() { |
|
48
|
|
|
return tokenIssuer; |
|
49
|
|
|
} |
|
50
|
|
|
public void setTokenIssuer(String tokenIssuer) { |
|
51
|
|
|
this.tokenIssuer = tokenIssuer; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
public String getTokenSigningKey() { |
|
55
|
|
|
return tokenSigningKey; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public void setTokenSigningKey(String tokenSigningKey) { |
|
59
|
|
|
this.tokenSigningKey = tokenSigningKey; |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|