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";
|
}
|
}
|