陶杰
2024-08-22 ee9032d9baf5f33e376d2d2699136e0a7b26bec7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.mzl.flower.config;
 
import lombok.Data;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * Properties for OAuth2 security.
 */
@Component
@ConfigurationProperties(prefix = "oauth2")
public class OAuth2Properties {
 
    @Getter
    private List<ClientConfiguration> clientConfigurations = new ArrayList<>();
 
    @Data
    public static class ClientConfiguration {
        //validity of the short-lived access token in secs (min: 60), don't make it too long
        private int accessTokenValidityInSeconds = 10 * 60;
        //validity of the refresh token in secs (defines the duration of "remember me")
        private int refreshTokenValidityInSecondsForRememberMe = 7 * 24 * 60 * 60;
        private String clientId = "mzl_pc";
        private String secret = "mzl_pc";
        private String clientType = "pc";
    }
}