Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
My_csdo
JustAuth
提交
b9ca048d
J
JustAuth
项目概览
My_csdo
/
JustAuth
与 Fork 源项目一致
Fork自
justauth / JustAuth
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9ca048d
编写于
5月 27, 2019
作者:
智布道
👁
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✏
修复部分问题,详情见update.md
上级
a07dcbd2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
7 deletion
+9
-7
src/main/java/me/zhyd/oauth/authorization/AuthorizationFactory.java
...ava/me/zhyd/oauth/authorization/AuthorizationFactory.java
+1
-1
src/main/java/me/zhyd/oauth/model/AuthSource.java
src/main/java/me/zhyd/oauth/model/AuthSource.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java
src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthTencentCloudRequest.java
...n/java/me/zhyd/oauth/request/AuthTencentCloudRequest.java
+2
-2
src/main/java/me/zhyd/oauth/utils/UrlBuilder.java
src/main/java/me/zhyd/oauth/utils/UrlBuilder.java
+2
-2
update.md
update.md
+2
-0
未找到文件。
src/main/java/me/zhyd/oauth/authorization/AuthorizationFactory.java
浏览文件 @
b9ca048d
...
...
@@ -63,7 +63,7 @@ public class AuthorizationFactory {
AuthorizationFactory
.
register
(
AuthSource
.
OSCHINA
,
new
OschinaAuthorization
());
AuthorizationFactory
.
register
(
AuthSource
.
QQ
,
new
QqAuthorization
());
AuthorizationFactory
.
register
(
AuthSource
.
TAOBAO
,
new
TaobaoAuthorization
());
AuthorizationFactory
.
register
(
AuthSource
.
TENCEN_CLOUD
,
new
TencentCloudAuthorization
());
AuthorizationFactory
.
register
(
AuthSource
.
TENCEN
T
_CLOUD
,
new
TencentCloudAuthorization
());
AuthorizationFactory
.
register
(
AuthSource
.
WECHAT
,
new
WeChatAuthorization
());
AuthorizationFactory
.
register
(
AuthSource
.
WEIBO
,
new
WeiboAuthorization
());
AuthorizationFactory
.
register
(
AuthSource
.
FACEBOOK
,
new
FacebookAuthorization
());
...
...
src/main/java/me/zhyd/oauth/model/AuthSource.java
浏览文件 @
b9ca048d
...
...
@@ -16,7 +16,7 @@ public enum AuthSource {
CSDN
,
CODING
,
OSCHINA
,
TENCEN_CLOUD
,
TENCEN
T
_CLOUD
,
ALIPAY
,
TAOBAO
,
QQ
,
...
...
src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java
浏览文件 @
b9ca048d
...
...
@@ -71,7 +71,7 @@ public class AuthAlipayRequest extends BaseAuthRequest {
city
=
response
.
getCity
();
return
AuthUser
.
builder
()
.
uuid
(
response
.
getUserId
())
.
username
(
response
.
getUserName
())
.
username
(
StringUtils
.
isEmpty
(
response
.
getUserName
())
?
response
.
getNickName
()
:
response
.
getUserName
())
.
nickname
(
response
.
getNickName
())
.
avatar
(
response
.
getAvatar
())
.
location
(
String
.
format
(
"%s %s"
,
StringUtils
.
isEmpty
(
province
)
?
""
:
province
,
StringUtils
.
isEmpty
(
city
)
?
""
:
city
))
...
...
src/main/java/me/zhyd/oauth/request/AuthTencentCloudRequest.java
浏览文件 @
b9ca048d
...
...
@@ -21,7 +21,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
public
class
AuthTencentCloudRequest
extends
BaseAuthRequest
{
public
AuthTencentCloudRequest
(
AuthConfig
config
)
{
super
(
config
,
AuthSource
.
TENCEN_CLOUD
);
super
(
config
,
AuthSource
.
TENCEN
T
_CLOUD
);
}
@Override
...
...
@@ -58,7 +58,7 @@ public class AuthTencentCloudRequest extends BaseAuthRequest {
.
email
(
object
.
getString
(
"email"
))
.
remark
(
object
.
getString
(
"slogan"
))
.
token
(
authToken
)
.
source
(
AuthSource
.
TENCEN_CLOUD
)
.
source
(
AuthSource
.
TENCEN
T
_CLOUD
)
.
build
();
}
}
src/main/java/me/zhyd/oauth/utils/UrlBuilder.java
浏览文件 @
b9ca048d
...
...
@@ -65,7 +65,7 @@ public class UrlBuilder {
private
static
final
String
WECHAT_REFRESH_TOKEN_PATTERN
=
"{0}?appid={1}&grant_type=refresh_token&refresh_token={2}"
;
private
static
final
String
WECHAT_USER_INFO_PATTERN
=
"{0}?access_token={1}&openid={2}&lang=zh_CN"
;
private
static
final
String
TAOBAO_AUTHORIZE_PATTERN
=
"{0}?response_type=code&client_id={1}&redirect_uri={2}&state=&view=web"
;
private
static
final
String
TAOBAO_AUTHORIZE_PATTERN
=
"{0}?response_type=code&client_id={1}&redirect_uri={2}&state=
{3}
&view=web"
;
private
static
final
String
TAOBAO_ACCESS_TOKEN_PATTERN
=
"{0}?client_id={1}&client_secret={2}&code={3}&redirect_uri={4}&grant_type=authorization_code"
;
private
static
final
String
FACEBOOK_AUTHORIZE_PATTERN
=
"{0}?client_id={1}&redirect_uri={2}&state={3}&response_type=code&scope="
;
...
...
@@ -503,7 +503,7 @@ public class UrlBuilder {
* @return full url
*/
public
static
String
getTaobaoAuthorizeUrl
(
String
clientId
,
String
redirectUrl
)
{
return
MessageFormat
.
format
(
TAOBAO_AUTHORIZE_PATTERN
,
ApiUrl
.
TAOBAO
.
authorize
(),
clientId
,
redirectUrl
);
return
MessageFormat
.
format
(
TAOBAO_AUTHORIZE_PATTERN
,
ApiUrl
.
TAOBAO
.
authorize
(),
clientId
,
redirectUrl
,
System
.
currentTimeMillis
()
);
}
/**
...
...
update.md
浏览文件 @
b9ca048d
...
...
@@ -2,6 +2,8 @@
1.
增加抖音和Linkedin的授权登陆
2.
修改部分图片命名
3.
优化部分代码
4.
修复
`AuthSource`
中腾讯云开发平台的拼写错误:
`TENCEN_CLOUD`
->
`TENCENT_CLOUD`
5.
修复支付宝登陆时用户名为空的问题
### 2019/05/24
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录