Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
justauth
JustAuth
提交
e84bd7cd
J
JustAuth
项目概览
justauth
/
JustAuth
1 年多 前同步成功
通知
394
Star
15212
Fork
2708
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
JustAuth
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e84bd7cd
编写于
12月 20, 2020
作者:
智布道
👁
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🔖
merge #101
上级
dce2bd1e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
46 addition
and
14 deletion
+46
-14
CHANGELOGS.md
CHANGELOGS.md
+11
-0
README.en-US.md
README.en-US.md
+3
-3
README.md
README.md
+3
-3
bin/version.txt
bin/version.txt
+1
-1
pom.xml
pom.xml
+6
-2
src/main/java/me/zhyd/oauth/config/AuthConfig.java
src/main/java/me/zhyd/oauth/config/AuthConfig.java
+9
-2
src/main/java/me/zhyd/oauth/request/AuthXmlyRequest.java
src/main/java/me/zhyd/oauth/request/AuthXmlyRequest.java
+6
-3
src/main/java/me/zhyd/oauth/utils/AuthChecker.java
src/main/java/me/zhyd/oauth/utils/AuthChecker.java
+6
-0
src/main/java/me/zhyd/oauth/utils/GlobalAuthUtils.java
src/main/java/me/zhyd/oauth/utils/GlobalAuthUtils.java
+1
-0
未找到文件。
CHANGELOGS.md
浏览文件 @
e84bd7cd
## 1.15.9
### 2020/12/20
-
发布 v1.15.9
-
PR
-
合并
[
Github#101
](
https://gitee.com/yadong.zhang/JustAuth/pulls/101
)
-
修改
-
修改喜马拉雅配置参数,将
`ClientOsType`
参数提到 AuthConfig 中
-
AuthChecker 中增加对喜马拉雅平台的校验
## 1.15.8
### 2020/10/25
...
...
README.en-US.md
浏览文件 @
e84bd7cd
...
...
@@ -6,7 +6,7 @@
</p>
<p
align=
"center"
>
<a
target=
"_blank"
href=
"https://search.maven.org/search?q=JustAuth"
>
<img
src=
"https://img.shields.io/badge/Maven%20Central-1.15.
8
-blue"
></img>
<img
src=
"https://img.shields.io/badge/Maven%20Central-1.15.
9
-blue"
></img>
</a>
<a
target=
"_blank"
href=
"https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE"
>
<img
src=
"https://img.shields.io/apm/l/vim-mode.svg?color=yellow"
></img>
...
...
@@ -15,7 +15,7 @@
<img
src=
"https://img.shields.io/badge/JDK-1.8+-green.svg"
></img>
</a>
<a
target=
"_blank"
href=
"https://apidoc.gitee.com/yadong.zhang/JustAuth/"
title=
"API文档"
>
<img
src=
"https://img.shields.io/badge/Api%20Docs-1.15.
8
-orange"
></img>
<img
src=
"https://img.shields.io/badge/Api%20Docs-1.15.
9
-orange"
></img>
</a>
<a
target=
"_blank"
href=
"https://justauth.wiki"
title=
"参考文档"
>
<img
src=
"https://img.shields.io/badge/Docs-latest-blueviolet.svg"
></img>
...
...
@@ -97,7 +97,7 @@ These artifacts are available from Maven Central:
<dependency>
<groupId>
me.zhyd.oauth
</groupId>
<artifactId>
JustAuth
</artifactId>
<version>
1.15.
8-beta.2
</version>
<version>
1.15.
9
</version>
</dependency>
```
-
Using JustAuth
...
...
README.md
浏览文件 @
e84bd7cd
...
...
@@ -6,7 +6,7 @@
</p>
<p
align=
"center"
>
<a
target=
"_blank"
href=
"https://search.maven.org/search?q=JustAuth"
>
<img
src=
"https://img.shields.io/badge/Maven%20Central-1.15.
8
-blue"
></img>
<img
src=
"https://img.shields.io/badge/Maven%20Central-1.15.
9
-blue"
></img>
</a>
<a
target=
"_blank"
href=
"https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE"
>
<img
src=
"https://img.shields.io/apm/l/vim-mode.svg?color=yellow"
></img>
...
...
@@ -15,7 +15,7 @@
<img
src=
"https://img.shields.io/badge/JDK-1.8+-green.svg"
></img>
</a>
<a
target=
"_blank"
href=
"https://apidoc.gitee.com/yadong.zhang/JustAuth/"
title=
"API文档"
>
<img
src=
"https://img.shields.io/badge/Api%20Docs-1.15.
8
-orange"
></img>
<img
src=
"https://img.shields.io/badge/Api%20Docs-1.15.
9
-orange"
></img>
</a>
<a
target=
"_blank"
href=
"https://justauth.wiki"
title=
"参考文档"
>
<img
src=
"https://img.shields.io/badge/Docs-latest-blueviolet.svg"
></img>
...
...
@@ -107,7 +107,7 @@ JustAuth 集成了诸如:Github、Gitee、支付宝、新浪微博、微信、
<dependency>
<groupId>
me.zhyd.oauth
</groupId>
<artifactId>
JustAuth
</artifactId>
<version>
1.15.
8
</version>
<version>
1.15.
9
</version>
</dependency>
```
-
调用api
...
...
bin/version.txt
浏览文件 @
e84bd7cd
1.15.
8
1.15.
9
pom.xml
浏览文件 @
e84bd7cd
...
...
@@ -6,7 +6,7 @@
<groupId>
me.zhyd.oauth
</groupId>
<artifactId>
JustAuth
</artifactId>
<version>
1.15.
8
</version>
<version>
1.15.
9
</version>
<name>
JustAuth
</name>
<url>
https://gitee.com/yadong.zhang/JustAuth
</url>
...
...
@@ -52,7 +52,7 @@
<maven.compiler.target>
1.8
</maven.compiler.target>
<maven-source.version>
2.2.1
</maven-source.version>
<maven-compiler.version>
3.8.1
</maven-compiler.version>
<maven-javadoc.version>
3.1.0
</maven-javadoc.version>
<maven-javadoc.version>
2.9.1
</maven-javadoc.version>
<cobertura-version>
2.7
</cobertura-version>
<maven-surefire-version>
2.20
</maven-surefire-version>
<maven-gpg-version>
1.6
</maven-gpg-version>
...
...
@@ -133,6 +133,10 @@
<goals>
<goal>
jar
</goal>
</goals>
<configuration>
<!-- add this to disable checking -->
<additionalparam>
-Xdoclint:none
</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
...
...
src/main/java/me/zhyd/oauth/config/AuthConfig.java
浏览文件 @
e84bd7cd
...
...
@@ -119,9 +119,16 @@ public class AuthConfig {
private
String
deviceId
;
/**
* 喜马拉雅:客户端
包名,如果client_os_type为1或2时必填。对Android客户端是包名,对IOS客户端是Bundle ID
* 喜马拉雅:客户端
操作系统类型,1-iOS系统,2-Android系统,3-Web
*
* @since 1.15.8
* @since 1.15.9
*/
private
Integer
clientOsType
;
/**
* 喜马拉雅:客户端包名,如果 {@link AuthConfig#clientOsType} 为1或2时必填。对Android客户端是包名,对IOS客户端是Bundle ID
*
* @since 1.15.9
*/
private
String
packId
;
}
src/main/java/me/zhyd/oauth/request/AuthXmlyRequest.java
浏览文件 @
e84bd7cd
...
...
@@ -12,14 +12,17 @@ import me.zhyd.oauth.model.AuthToken;
import
me.zhyd.oauth.model.AuthUser
;
import
me.zhyd.oauth.utils.GlobalAuthUtils
;
import
me.zhyd.oauth.utils.UrlBuilder
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.TreeMap
;
/**
* 喜马拉雅登录
*
* @author zwzch (zwzch4j@gmail.com)
* @since 1.15.
8
* @since 1.15.
9
*/
public
class
AuthXmlyRequest
extends
AuthDefaultRequest
{
...
...
@@ -89,7 +92,7 @@ public class AuthXmlyRequest extends AuthDefaultRequest {
public
AuthUser
getUserInfo
(
AuthToken
authToken
)
{
Map
<
String
,
String
>
map
=
new
TreeMap
<>();
map
.
put
(
"app_key"
,
config
.
getClientId
());
map
.
put
(
"client_os_type"
,
"2"
);
map
.
put
(
"client_os_type"
,
Optional
.
ofNullable
(
config
.
getClientOsType
()).
orElse
(
3
).
toString
()
);
map
.
put
(
"device_id"
,
config
.
getDeviceId
());
map
.
put
(
"pack_id"
,
config
.
getPackId
());
map
.
put
(
"access_token"
,
authToken
.
getAccessToken
());
...
...
@@ -113,7 +116,7 @@ public class AuthXmlyRequest extends AuthDefaultRequest {
*
* @param object 接口返回的结果
*/
private
void
checkResponse
(
JSONObject
object
){
private
void
checkResponse
(
JSONObject
object
)
{
if
(
object
.
containsKey
(
"errcode"
))
{
throw
new
AuthException
(
object
.
getIntValue
(
"error_no"
),
object
.
getString
(
"error_desc"
));
}
...
...
src/main/java/me/zhyd/oauth/utils/AuthChecker.java
浏览文件 @
e84bd7cd
...
...
@@ -38,6 +38,12 @@ public class AuthChecker {
if
(
isSupported
&&
AuthDefaultSource
.
CODING
==
source
)
{
isSupported
=
StringUtils
.
isNotEmpty
(
config
.
getCodingGroupName
());
}
if
(
isSupported
&&
AuthDefaultSource
.
XMLY
==
source
)
{
isSupported
=
StringUtils
.
isNotEmpty
(
config
.
getDeviceId
())
&&
null
!=
config
.
getClientOsType
();
if
(
isSupported
)
{
isSupported
=
config
.
getClientOsType
()
==
3
||
StringUtils
.
isNotEmpty
(
config
.
getPackId
());
}
}
return
isSupported
;
}
...
...
src/main/java/me/zhyd/oauth/utils/GlobalAuthUtils.java
浏览文件 @
e84bd7cd
...
...
@@ -227,6 +227,7 @@ public class GlobalAuthUtils {
* @param params 加密参数
* @param clientSecret 平台应用的授权key
* @return Signature
* @since 1.15.9
*/
public
static
String
generateXmlySignature
(
Map
<
String
,
String
>
params
,
String
clientSecret
)
{
TreeMap
<
String
,
String
>
map
=
new
TreeMap
<>(
params
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录