Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
和雨追风
JustAuth
提交
de038b85
J
JustAuth
项目概览
和雨追风
/
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,发现更多精彩内容 >>
提交
de038b85
编写于
9月 30, 2019
作者:
H
Hongwei Peng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update doc
上级
da8ec82e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
9 deletion
+16
-9
README.en-US.md
README.en-US.md
+7
-1
README.md
README.md
+6
-0
example.md
example.md
+1
-1
src/main/java/me/zhyd/oauth/request/AuthTwitterRequest.java
src/main/java/me/zhyd/oauth/request/AuthTwitterRequest.java
+2
-7
未找到文件。
README.en-US.md
浏览文件 @
de038b85
...
...
@@ -70,6 +70,11 @@
<td
align=
"center"
width=
"200"
><img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/eleme.png"
width=
"20"
></td>
</tr>
</table>
<table>
<tr>
<td
align=
"center"
width=
"200"
><img
src=
""
width=
"20"
title=
"Twitter"
></td>
</tr>
</table>
</center>
-------------------------------------------------------------------------------
...
...
@@ -157,6 +162,7 @@ authRequest.login(callback);
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/gitlab.png"
width=
"20"
>
|
[
AuthGitlabRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGitlabRequest.java
)
|
<a
href=
"https://docs.gitlab.com/ee/api/oauth2.html"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/meituan.png"
width=
"20"
>
|
[
AuthMeituanRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthMeituanRequest.java
)
|
<a
href=
"http://open.waimai.meituan.com/openapi_docs/oauth/"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/eleme.png"
width=
"20"
>
|
[
AuthElemeRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthElemeRequest.java
)
|
<a
href=
"https://open.shop.ele.me/openapi/documents/khd001"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
""
width=
"20"
>
|
[
AuthTwitterRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthTwitterRequest.java
)
|
<a
href=
"https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with-twitter/guides/implementing-sign-in-with-twitter"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/csdn.png"
width=
"20"
>
|
[
AuthCsdnRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthCsdnRequest.java
)
| 无 |
...
...
@@ -187,4 +193,4 @@ I look forward to your joining us.
## References
-
[
The OAuth 2.0 Authorization Framework
](
https://tools.ietf.org/html/rfc6749
)
-
[
OAuth 2.0
](
https://oauth.net/2/
)
\ No newline at end of file
-
[
OAuth 2.0
](
https://oauth.net/2/
)
README.md
浏览文件 @
de038b85
...
...
@@ -70,6 +70,11 @@
<td
align=
"center"
width=
"200"
><img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/eleme.png"
width=
"20"
></td>
</tr>
</table>
<table>
<tr>
<td
align=
"center"
width=
"200"
><img
src=
""
width=
"20"
title=
"Twitter"
></td>
</tr>
</table>
</center>
-------------------------------------------------------------------------------
...
...
@@ -163,6 +168,7 @@ authRequest.login(callback);
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/gitlab.png"
width=
"20"
>
|
[
AuthGitlabRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGitlabRequest.java
)
|
<a
href=
"https://docs.gitlab.com/ee/api/oauth2.html"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/meituan.png"
width=
"20"
>
|
[
AuthMeituanRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthMeituanRequest.java
)
|
<a
href=
"http://open.waimai.meituan.com/openapi_docs/oauth/"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/eleme.png"
width=
"20"
>
|
[
AuthElemeRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthElemeRequest.java
)
|
<a
href=
"https://open.shop.ele.me/openapi/documents/khd001"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
""
width=
"20"
>
|
[
AuthTwitterRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthTwitterRequest.java
)
|
<a
href=
"https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with-twitter/guides/implementing-sign-in-with-twitter"
target=
"_blank"
>
参考文档
</a>
|
|
<img
src=
"https://gitee.com/yadong.zhang/static/raw/master/JustAuth/csdn.png"
width=
"20"
>
|
[
AuthCsdnRequest
](
https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthCsdnRequest.java
)
| 无 |
_请知悉:经咨询CSDN官方客服得知,CSDN的授权开放平台已经下线。如果以前申请过的应用,可以继续使用,但是不再支持申请新的应用。so, 本项目中的CSDN登录只能针对少部分用户使用了_
...
...
example.md
浏览文件 @
de038b85
...
...
@@ -98,7 +98,7 @@ _注:非全部平台,部分平台可能不存在图例_
#### 授权Twitter
暂无
![
授权Twitter
](
"授权Twitter"
)
#### 授权csdn
...
...
src/main/java/me/zhyd/oauth/request/AuthTwitterRequest.java
浏览文件 @
de038b85
...
...
@@ -50,9 +50,7 @@ public class AuthTwitterRequest extends AuthDefaultRequest {
oauthParams
.
put
(
"oauth_callback"
,
config
.
getRedirectUri
());
oauthParams
.
put
(
"oauth_signature"
,
generateTwitterSignature
(
oauthParams
,
"POST"
,
baseUrl
,
config
.
getClientSecret
(),
null
));
String
header
=
buildHeader
(
oauthParams
);
HttpResponse
requestToken
=
HttpRequest
.
post
(
baseUrl
)
.
header
(
"Authorization"
,
header
)
.
execute
();
HttpResponse
requestToken
=
HttpRequest
.
post
(
baseUrl
).
header
(
"Authorization"
,
header
).
execute
();
checkResponse
(
requestToken
);
Map
<
String
,
Object
>
res
=
GlobalAuthUtil
.
parseQueryToMap
(
requestToken
.
body
());
...
...
@@ -96,7 +94,6 @@ public class AuthTwitterRequest extends AuthDefaultRequest {
@Override
protected
AuthUser
getUserInfo
(
AuthToken
authToken
)
{
Map
<
String
,
Object
>
queryParams
=
new
HashMap
<>();
queryParams
.
put
(
"user_id"
,
authToken
.
getUserId
());
queryParams
.
put
(
"screen_name"
,
authToken
.
getScreenName
());
...
...
@@ -109,9 +106,7 @@ public class AuthTwitterRequest extends AuthDefaultRequest {
params
.
putAll
(
queryParams
);
oauthParams
.
put
(
"oauth_signature"
,
generateTwitterSignature
(
params
,
"GET"
,
source
.
userInfo
(),
config
.
getClientSecret
(),
authToken
.
getOauthTokenSecret
()));
String
header
=
buildHeader
(
oauthParams
);
HttpResponse
response
=
HttpRequest
.
get
(
userInfoUrl
(
authToken
))
.
header
(
"Authorization"
,
header
)
.
execute
();
HttpResponse
response
=
HttpRequest
.
get
(
userInfoUrl
(
authToken
)).
header
(
"Authorization"
,
header
).
execute
();
checkResponse
(
response
);
JSONObject
userInfo
=
JSONObject
.
parseObject
(
response
.
body
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录