2727import static org .minbox .framework .api .boot .autoconfigure .oauth .ApiBootOauthProperties .API_BOOT_OAUTH_PREFIX ;
2828
2929/**
30- * 整合Oauth2 相关属性配置
30+ * Configure Oauth2 properties class
3131 *
3232 * @author 恒宇少年
3333 */
3636@ ConfigurationProperties (prefix = API_BOOT_OAUTH_PREFIX )
3737public class ApiBootOauthProperties {
3838 /**
39- * 安全配置前缀
39+ * config prefix
4040 */
4141 public static final String API_BOOT_OAUTH_PREFIX = "api.boot.oauth" ;
4242 /**
43- * Oauth2认证存储方式,默认内存方式
43+ * Configure oauth authentication information storage mode
44+ * <p>
45+ * The default use {@link OAuthAway#memory}
4446 *
4547 * @see OAuthAway
4648 */
@@ -59,89 +61,36 @@ public class ApiBootOauthProperties {
5961 @ Deprecated
6062 private String clientSecret = "ApiBootSecret" ;
6163 /**
62- * 客户端授权类型集合
64+ * Configure simple client grant types
6365 * 2.1.1. After the RELEASE version, the attribute is discarded and replaced by clients.
6466 */
6567 @ Deprecated
6668 private String [] grantTypes = new String []{"password" , "refresh_token" };
6769 /**
68- * 客户端作用域集合
70+ * Configure simple client scopes
6971 * 2.1.1. After the RELEASE version, the attribute is discarded and replaced by clients.
7072 */
7173 @ Deprecated
7274 private String [] scopes = new String []{"api" };
7375 /**
74- * 资源编号
76+ * Configure simple client resource id
7577 * 2.1.1. After the RELEASE version, the attribute is discarded and replaced by clients.
7678 */
7779 @ Deprecated
7880 private String resourceId = "api" ;
7981
8082 /**
81- * 配置JWT格式化Oauth2返回的token
83+ * Configure to use jwt to format oauth token
8284 */
8385 private Jwt jwt = new Jwt ();
8486 /**
8587 * configure multiple clients
88+ * <p>
89+ * Add a client information by default and use the default configuration
8690 */
87- private List <Client > clients = new ArrayList () {{
88- add (new Client ());
89- }};
90-
91- /**
92- * Oauth2 Client
93- * Used to configure multiple clients
94- */
95- @ Data
96- public static class Client {
97- /**
98- * oauth2 client id
99- */
100- private String clientId = "ApiBoot" ;
101- /**
102- * oauth2 client secret
103- */
104- private String clientSecret = "ApiBootSecret" ;
105- /**
106- * oauth2 client grant types
107- * default value is "password,refresh_token"
108- */
109- private String [] grantTypes = new String []{"password" , "refresh_token" };
110- /**
111- * oauth2 client scope
112- * default value is "api"
113- */
114- private String [] scopes = new String []{"api" };
115- /**
116- * oauth2 application resource id
117- * default value is "api"
118- */
119- private String [] resourceId = new String []{"api" };
120- /**
121- * oauth2 access token validity seconds
122- * default value is 2 hours (7200 second)
123- */
124- private int accessTokenValiditySeconds = 60 * 60 * 2 ;
125- /**
126- * oauth2 refresh token validity seconds
127- * <p>
128- * The default value is 30 days(2592000 seconds)
129- */
130- private int refreshTokenValiditySeconds = 60 * 60 * 24 * 30 ;
131- }
132-
133- /**
134- * 自定义Jwt相关的配置
135- */
136- @ Data
137- public static class Jwt {
138- /**
139- * 开启Jwt转换AccessToken
140- */
141- private boolean enable = false ;
142- /**
143- * Jwt转换时使用的秘钥key
144- */
145- private String signKey = "ApiBoot" ;
146- }
91+ private List <OAuthClient > clients = new ArrayList () {
92+ {
93+ add (new OAuthClient ());
94+ }
95+ };
14796}
0 commit comments