👌 去除一些 warning
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
## 版本更新记录
|
## 版本更新记录
|
||||||
|
|
||||||
### 【1.3.4】2020-08-26
|
### 【1.3.4.beta】2020-08-29
|
||||||
|
|
||||||
- 升级 `JustAuth` 版本:1.15.7-beta.3,支持自定义 http config
|
- 升级 `JustAuth` 版本:1.15.7-beta.3,支持自定义 http config
|
||||||
|
|
||||||
|
|||||||
28
README.md
28
README.md
@@ -28,7 +28,7 @@ https://github.com/xkcoding/justauth-spring-boot-starter-demo
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xkcoding.justauth</groupId>
|
<groupId>com.xkcoding.justauth</groupId>
|
||||||
<artifactId>justauth-spring-boot-starter</artifactId>
|
<artifactId>justauth-spring-boot-starter</artifactId>
|
||||||
<version>1.3.4</version>
|
<version>1.3.4.beta</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -537,9 +537,29 @@ justauth:
|
|||||||
|
|
||||||
注:当项目中使用了自定义的第三方登录,并且需要使用代理时,也要在 `http-config` 节点下添加相关配置,格式参考上面示例
|
注:当项目中使用了自定义的第三方登录,并且需要使用代理时,也要在 `http-config` 节点下添加相关配置,格式参考上面示例
|
||||||
|
|
||||||
## 5. 附录
|
## 5. 自定义 Scopes
|
||||||
|
|
||||||
### 5.1. `justauth` 配置列表
|
修改配置文件,增加如下配置:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
justauth:
|
||||||
|
enabled: true
|
||||||
|
type:
|
||||||
|
QQ:
|
||||||
|
client-id: 10**********6
|
||||||
|
client-secret: 1f7d08**********5b7**********29e
|
||||||
|
redirect-uri: http://oauth.xkcoding.com/demo/oauth/qq/callback
|
||||||
|
union-id: false
|
||||||
|
scopes:
|
||||||
|
- get_user_info
|
||||||
|
- xxxx
|
||||||
|
```
|
||||||
|
|
||||||
|
注:你可以前往 `me.zhyd.oauth.enums.scope` 包下查看各个渠道所支持的 scopes,当然你可以不配置该项,JustAuth 会默认添加上一些基础 scope
|
||||||
|
|
||||||
|
## 6. 附录
|
||||||
|
|
||||||
|
### 6.1. `justauth` 配置列表
|
||||||
|
|
||||||
| 属性名 | 类型 | 默认值 | 可选项 | 描述 |
|
| 属性名 | 类型 | 默认值 | 可选项 | 描述 |
|
||||||
| ------------------ | ------------------------------------------------------------ | ------ | ---------- | ---------------------- |
|
| ------------------ | ------------------------------------------------------------ | ------ | ---------- | ---------------------- |
|
||||||
@@ -613,7 +633,7 @@ justauth:
|
|||||||
| `justauth.extend.config.keys` | `java.lang.String` | 无 | | key 必须在 `justauth.extend.enum-class` 配置的枚举类中声明 |
|
| `justauth.extend.config.keys` | `java.lang.String` | 无 | | key 必须在 `justauth.extend.enum-class` 配置的枚举类中声明 |
|
||||||
| `justauth.extend.config.values` | `com.xkcoding.justauth.autoconfigure.ExtendProperties.ExtendRequestConfig` | 无 | | value 就是 `AuthConfig` 的子类,增加了一个 `request-class` 属性配置请求的全类名,具体参考类[`ExtendProperties.ExtendRequestConfig`](https://github.com/justauth/justauth-spring-boot-starter/blob/master/src/main/java/com/xkcoding/justauth/autoconfigure/ExtendProperties.java#L49-L54) |
|
| `justauth.extend.config.values` | `com.xkcoding.justauth.autoconfigure.ExtendProperties.ExtendRequestConfig` | 无 | | value 就是 `AuthConfig` 的子类,增加了一个 `request-class` 属性配置请求的全类名,具体参考类[`ExtendProperties.ExtendRequestConfig`](https://github.com/justauth/justauth-spring-boot-starter/blob/master/src/main/java/com/xkcoding/justauth/autoconfigure/ExtendProperties.java#L49-L54) |
|
||||||
|
|
||||||
### 5.2. SNAPSHOT版本
|
### 6.2. SNAPSHOT版本
|
||||||
|
|
||||||
如果需要体验快照版本,可以在你的 `pom.xml`进行如下配置:
|
如果需要体验快照版本,可以在你的 `pom.xml`进行如下配置:
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<groupId>com.xkcoding.justauth</groupId>
|
<groupId>com.xkcoding.justauth</groupId>
|
||||||
<artifactId>justauth-spring-boot-starter</artifactId>
|
<artifactId>justauth-spring-boot-starter</artifactId>
|
||||||
<version>1.3.4</version>
|
<version>1.3.4.beta</version>
|
||||||
|
|
||||||
<name>justauth-spring-boot-starter</name>
|
<name>justauth-spring-boot-starter</name>
|
||||||
<url>https://github.com/xkcoding/justauth-spring-boot-starter</url>
|
<url>https://github.com/xkcoding/justauth-spring-boot-starter</url>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class AuthRequestFactory {
|
|||||||
*
|
*
|
||||||
* @return Oauth列表
|
* @return Oauth列表
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public List<String> oauthList() {
|
public List<String> oauthList() {
|
||||||
// 默认列表
|
// 默认列表
|
||||||
List<String> defaultList = new ArrayList<>(properties.getType().keySet());
|
List<String> defaultList = new ArrayList<>(properties.getType().keySet());
|
||||||
@@ -118,7 +118,7 @@ public class AuthRequestFactory {
|
|||||||
* @param source {@link AuthSource}
|
* @param source {@link AuthSource}
|
||||||
* @return {@link AuthRequest}
|
* @return {@link AuthRequest}
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
private AuthRequest getExtendRequest(Class clazz, String source) {
|
private AuthRequest getExtendRequest(Class clazz, String source) {
|
||||||
String upperSource = source.toUpperCase();
|
String upperSource = source.toUpperCase();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,155 +1,139 @@
|
|||||||
{
|
{
|
||||||
"properties": [
|
|
||||||
{
|
|
||||||
"name": "justauth.type",
|
|
||||||
"type": "java.util.Map<me.zhyd.oauth.config.AuthSource,me.zhyd.oauth.config.AuthConfig>",
|
|
||||||
"description": "JustAuth 配置.",
|
|
||||||
"sourceType": "com.xkcoding.justauth.autoconfigure.JustAuthProperties"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"hints": [
|
"hints": [
|
||||||
{
|
{
|
||||||
"name": "justauth.type.keys",
|
"name": "justauth.type.keys",
|
||||||
"providers": [
|
"values": [
|
||||||
{
|
{
|
||||||
"name": "handle-as",
|
"value": "GITHUB",
|
||||||
"values": [
|
"description": "GITHUB."
|
||||||
{
|
},
|
||||||
"value": "GITHUB",
|
{
|
||||||
"description": "GITHUB."
|
"value": "WEIBO",
|
||||||
},
|
"description": "WEIBO."
|
||||||
{
|
},
|
||||||
"value": "WEIBO",
|
{
|
||||||
"description": "WEIBO."
|
"value": "GITEE",
|
||||||
},
|
"description": "GITEE."
|
||||||
{
|
},
|
||||||
"value": "GITEE",
|
{
|
||||||
"description": "GITEE."
|
"value": "DINGTALK",
|
||||||
},
|
"description": "DINGTALK."
|
||||||
{
|
},
|
||||||
"value": "DINGTALK",
|
{
|
||||||
"description": "DINGTALK."
|
"value": "BAIDU",
|
||||||
},
|
"description": "BAIDU."
|
||||||
{
|
},
|
||||||
"value": "BAIDU",
|
{
|
||||||
"description": "BAIDU."
|
"value": "CSDN",
|
||||||
},
|
"description": "CSDN."
|
||||||
{
|
},
|
||||||
"value": "CSDN",
|
{
|
||||||
"description": "CSDN."
|
"value": "CODING",
|
||||||
},
|
"description": "CODING."
|
||||||
{
|
},
|
||||||
"value": "CODING",
|
{
|
||||||
"description": "CODING."
|
"value": "OSCHINA",
|
||||||
},
|
"description": "OSCHINA."
|
||||||
{
|
},
|
||||||
"value": "OSCHINA",
|
{
|
||||||
"description": "OSCHINA."
|
"value": "ALIPAY",
|
||||||
},
|
"description": "ALIPAY."
|
||||||
{
|
},
|
||||||
"value": "ALIPAY",
|
{
|
||||||
"description": "ALIPAY."
|
"value": "QQ",
|
||||||
},
|
"description": "QQ."
|
||||||
{
|
},
|
||||||
"value": "QQ",
|
{
|
||||||
"description": "QQ."
|
"value": "TAOBAO",
|
||||||
},
|
"description": "TAOBAO."
|
||||||
{
|
},
|
||||||
"value": "TAOBAO",
|
{
|
||||||
"description": "TAOBAO."
|
"value": "GOOGLE",
|
||||||
},
|
"description": "GOOGLE."
|
||||||
{
|
},
|
||||||
"value": "GOOGLE",
|
{
|
||||||
"description": "GOOGLE."
|
"value": "FACEBOOK",
|
||||||
},
|
"description": "FACEBOOK."
|
||||||
{
|
},
|
||||||
"value": "FACEBOOK",
|
{
|
||||||
"description": "FACEBOOK."
|
"value": "DOUYIN",
|
||||||
},
|
"description": "DOUYIN."
|
||||||
{
|
},
|
||||||
"value": "DOUYIN",
|
{
|
||||||
"description": "DOUYIN."
|
"value": "LINKEDIN",
|
||||||
},
|
"description": "LINKEDIN."
|
||||||
{
|
},
|
||||||
"value": "LINKEDIN",
|
{
|
||||||
"description": "LINKEDIN."
|
"value": "MICROSOFT",
|
||||||
},
|
"description": "MICROSOFT."
|
||||||
{
|
},
|
||||||
"value": "MICROSOFT",
|
{
|
||||||
"description": "MICROSOFT."
|
"value": "MI",
|
||||||
},
|
"description": "MI."
|
||||||
{
|
},
|
||||||
"value": "MI",
|
{
|
||||||
"description": "MI."
|
"value": "TOUTIAO",
|
||||||
},
|
"description": "TOUTIAO."
|
||||||
{
|
},
|
||||||
"value": "TOUTIAO",
|
{
|
||||||
"description": "TOUTIAO."
|
"value": "TEAMBITION",
|
||||||
},
|
"description": "TEAMBITION."
|
||||||
{
|
},
|
||||||
"value": "TEAMBITION",
|
{
|
||||||
"description": "TEAMBITION."
|
"value": "RENREN",
|
||||||
},
|
"description": "RENREN."
|
||||||
{
|
},
|
||||||
"value": "RENREN",
|
{
|
||||||
"description": "RENREN."
|
"value": "PINTEREST",
|
||||||
},
|
"description": "PINTEREST."
|
||||||
{
|
},
|
||||||
"value": "PINTEREST",
|
{
|
||||||
"description": "PINTEREST."
|
"value": "STACK_OVERFLOW",
|
||||||
},
|
"description": "STACK_OVERFLOW."
|
||||||
{
|
},
|
||||||
"value": "STACK_OVERFLOW",
|
{
|
||||||
"description": "STACK_OVERFLOW."
|
"value": "HUAWEI",
|
||||||
},
|
"description": "HUAWEI."
|
||||||
{
|
},
|
||||||
"value": "HUAWEI",
|
{
|
||||||
"description": "HUAWEI."
|
"value": "WECHAT_OPEN",
|
||||||
},
|
"description": "WeChat open platform."
|
||||||
{
|
},
|
||||||
"value": "WECHAT_OPEN",
|
{
|
||||||
"description": "WeChat open platform."
|
"value": "WECHAT_ENTERPRISE",
|
||||||
},
|
"description": "WeChat enterprise platform."
|
||||||
{
|
},
|
||||||
"value": "WECHAT_ENTERPRISE",
|
{
|
||||||
"description": "WeChat enterprise platform."
|
"value": "WECHAT_MP",
|
||||||
},
|
"description": "WeChat Official Platform."
|
||||||
{
|
},
|
||||||
"value": "WECHAT_MP",
|
{
|
||||||
"description": "WeChat Official Platform."
|
"value": "KUJIALE",
|
||||||
},
|
"description": "KUJIALE."
|
||||||
{
|
},
|
||||||
"value": "KUJIALE",
|
{
|
||||||
"description": "KUJIALE."
|
"value": "GITLAB",
|
||||||
},
|
"description": "GITLAB."
|
||||||
{
|
},
|
||||||
"value": "GITLAB",
|
{
|
||||||
"description": "GITLAB."
|
"value": "MEITUAN",
|
||||||
},
|
"description": "MEITUAN."
|
||||||
{
|
},
|
||||||
"value": "MEITUAN",
|
{
|
||||||
"description": "MEITUAN."
|
"value": "ELEME",
|
||||||
},
|
"description": "ELEME."
|
||||||
{
|
},
|
||||||
"value": "ELEME",
|
{
|
||||||
"description": "ELEME."
|
"value": "GITLAB",
|
||||||
},
|
"description": "GITLAB."
|
||||||
{
|
},
|
||||||
"value": "GITLAB",
|
{
|
||||||
"description": "GITLAB."
|
"value": "TWITTER",
|
||||||
},
|
"description": "TWITTER."
|
||||||
{
|
},
|
||||||
"value": "TWITTER",
|
{
|
||||||
"description": "TWITTER."
|
"value": "ALIYUN",
|
||||||
},
|
"description": "ALIYUN."
|
||||||
{
|
|
||||||
"value": "ALIYUN",
|
|
||||||
"description": "ALIYUN."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"parameters": {
|
|
||||||
"target": "me.zhyd.oauth.config.AuthSource"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user