Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
justauth
JustAuth
提交
64aa1940
J
JustAuth
项目概览
justauth
/
JustAuth
1 年多 前同步成功
通知
391
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看板
提交
64aa1940
编写于
7月 27, 2019
作者:
智布道
👁
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💡
优化注释
上级
56c1e4ea
变更
43
隐藏空白更改
内联
并排
Showing
43 changed file
with
28 addition
and
47 deletion
+28
-47
src/main/java/me/zhyd/oauth/config/AuthConfig.java
src/main/java/me/zhyd/oauth/config/AuthConfig.java
+0
-1
src/main/java/me/zhyd/oauth/config/AuthSource.java
src/main/java/me/zhyd/oauth/config/AuthSource.java
+0
-1
src/main/java/me/zhyd/oauth/enums/AuthToutiaoErrorCode.java
src/main/java/me/zhyd/oauth/enums/AuthToutiaoErrorCode.java
+0
-1
src/main/java/me/zhyd/oauth/enums/AuthUserGender.java
src/main/java/me/zhyd/oauth/enums/AuthUserGender.java
+0
-1
src/main/java/me/zhyd/oauth/exception/AuthException.java
src/main/java/me/zhyd/oauth/exception/AuthException.java
+0
-1
src/main/java/me/zhyd/oauth/model/AuthCallback.java
src/main/java/me/zhyd/oauth/model/AuthCallback.java
+0
-1
src/main/java/me/zhyd/oauth/model/AuthResponse.java
src/main/java/me/zhyd/oauth/model/AuthResponse.java
+0
-1
src/main/java/me/zhyd/oauth/model/AuthResponseStatus.java
src/main/java/me/zhyd/oauth/model/AuthResponseStatus.java
+0
-1
src/main/java/me/zhyd/oauth/model/AuthToken.java
src/main/java/me/zhyd/oauth/model/AuthToken.java
+0
-1
src/main/java/me/zhyd/oauth/model/AuthUser.java
src/main/java/me/zhyd/oauth/model/AuthUser.java
+0
-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/AuthBaiduRequest.java
src/main/java/me/zhyd/oauth/request/AuthBaiduRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthCodingRequest.java
src/main/java/me/zhyd/oauth/request/AuthCodingRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthCsdnRequest.java
src/main/java/me/zhyd/oauth/request/AuthCsdnRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthDefaultRequest.java
src/main/java/me/zhyd/oauth/request/AuthDefaultRequest.java
+5
-1
src/main/java/me/zhyd/oauth/request/AuthDingTalkRequest.java
src/main/java/me/zhyd/oauth/request/AuthDingTalkRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthDouyinRequest.java
src/main/java/me/zhyd/oauth/request/AuthDouyinRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthFacebookRequest.java
src/main/java/me/zhyd/oauth/request/AuthFacebookRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java
src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthGithubRequest.java
src/main/java/me/zhyd/oauth/request/AuthGithubRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthGoogleRequest.java
src/main/java/me/zhyd/oauth/request/AuthGoogleRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthLinkedinRequest.java
src/main/java/me/zhyd/oauth/request/AuthLinkedinRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthMiRequest.java
src/main/java/me/zhyd/oauth/request/AuthMiRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthMicrosoftRequest.java
...main/java/me/zhyd/oauth/request/AuthMicrosoftRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthOschinaRequest.java
src/main/java/me/zhyd/oauth/request/AuthOschinaRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthPinterestRequest.java
...main/java/me/zhyd/oauth/request/AuthPinterestRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthQqRequest.java
src/main/java/me/zhyd/oauth/request/AuthQqRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthRenrenRequest.java
src/main/java/me/zhyd/oauth/request/AuthRenrenRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthRequest.java
src/main/java/me/zhyd/oauth/request/AuthRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthStackOverflowRequest.java
.../java/me/zhyd/oauth/request/AuthStackOverflowRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthTaobaoRequest.java
src/main/java/me/zhyd/oauth/request/AuthTaobaoRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthTeambitionRequest.java
...ain/java/me/zhyd/oauth/request/AuthTeambitionRequest.java
+0
-1
src/main/java/me/zhyd/oauth/request/AuthTencentCloudRequest.java
...n/java/me/zhyd/oauth/request/AuthTencentCloudRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthToutiaoRequest.java
src/main/java/me/zhyd/oauth/request/AuthToutiaoRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthWeChatRequest.java
src/main/java/me/zhyd/oauth/request/AuthWeChatRequest.java
+1
-1
src/main/java/me/zhyd/oauth/request/AuthWeiboRequest.java
src/main/java/me/zhyd/oauth/request/AuthWeiboRequest.java
+1
-2
src/main/java/me/zhyd/oauth/utils/AuthChecker.java
src/main/java/me/zhyd/oauth/utils/AuthChecker.java
+0
-1
src/main/java/me/zhyd/oauth/utils/GlobalAuthUtil.java
src/main/java/me/zhyd/oauth/utils/GlobalAuthUtil.java
+0
-1
src/main/java/me/zhyd/oauth/utils/IpUtils.java
src/main/java/me/zhyd/oauth/utils/IpUtils.java
+2
-3
src/main/java/me/zhyd/oauth/utils/UrlBuilder.java
src/main/java/me/zhyd/oauth/utils/UrlBuilder.java
+0
-1
src/test/java/me/zhyd/oauth/AuthRequestTest.java
src/test/java/me/zhyd/oauth/AuthRequestTest.java
+0
-1
src/test/java/me/zhyd/oauth/utils/CustomTest.java
src/test/java/me/zhyd/oauth/utils/CustomTest.java
+0
-3
update.md
update.md
+5
-0
未找到文件。
src/main/java/me/zhyd/oauth/config/AuthConfig.java
浏览文件 @
64aa1940
...
...
@@ -6,7 +6,6 @@ import lombok.*;
* JustAuth配置类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.9.3
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/config/AuthSource.java
浏览文件 @
64aa1940
...
...
@@ -7,7 +7,6 @@ import me.zhyd.oauth.model.AuthResponseStatus;
* 各api需要的url, 用枚举类分平台类型管理
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.0
*/
public
enum
AuthSource
{
...
...
src/main/java/me/zhyd/oauth/enums/AuthToutiaoErrorCode.java
浏览文件 @
64aa1940
...
...
@@ -7,7 +7,6 @@ import lombok.Getter;
* 今日头条授权登录时的异常状态码
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/enums/AuthUserGender.java
浏览文件 @
64aa1940
...
...
@@ -9,7 +9,6 @@ import java.util.Arrays;
* 用户性别
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/exception/AuthException.java
浏览文件 @
64aa1940
...
...
@@ -4,7 +4,6 @@ import me.zhyd.oauth.model.AuthResponseStatus;
/**
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthException
extends
RuntimeException
{
...
...
src/main/java/me/zhyd/oauth/model/AuthCallback.java
浏览文件 @
64aa1940
...
...
@@ -7,7 +7,6 @@ import lombok.Setter;
* 授权回调时的参数类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/model/AuthResponse.java
浏览文件 @
64aa1940
...
...
@@ -8,7 +8,6 @@ import lombok.Setter;
* JustAuth统一授权响应类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/model/AuthResponseStatus.java
浏览文件 @
64aa1940
...
...
@@ -5,7 +5,6 @@ import lombok.Getter;
/**
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/model/AuthToken.java
浏览文件 @
64aa1940
...
...
@@ -9,7 +9,6 @@ import lombok.Setter;
* 授权所需的token
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/model/AuthUser.java
浏览文件 @
64aa1940
...
...
@@ -10,7 +10,6 @@ import me.zhyd.oauth.enums.AuthUserGender;
* 授权成功后的用户信息,根据授权平台的不同,获取的数据完整性也不同
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Getter
...
...
src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java
浏览文件 @
64aa1940
...
...
@@ -21,7 +21,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 支付宝登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthAlipayRequest
extends
AuthDefaultRequest
{
...
...
@@ -90,6 +89,7 @@ public class AuthAlipayRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthBaiduRequest.java
浏览文件 @
64aa1940
...
...
@@ -15,7 +15,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 百度账号登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthBaiduRequest
extends
AuthDefaultRequest
{
...
...
@@ -83,6 +82,7 @@ public class AuthBaiduRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthCodingRequest.java
浏览文件 @
64aa1940
...
...
@@ -15,7 +15,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* Cooding登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthCodingRequest
extends
AuthDefaultRequest
{
...
...
@@ -75,6 +74,7 @@ public class AuthCodingRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthCsdnRequest.java
浏览文件 @
64aa1940
...
...
@@ -14,7 +14,6 @@ import me.zhyd.oauth.model.AuthUser;
* CSDN登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Deprecated
...
...
src/main/java/me/zhyd/oauth/request/AuthDefaultRequest.java
浏览文件 @
64aa1940
...
...
@@ -16,7 +16,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @author yangkai.shen (https://xkcoding.com)
* @version 1.0
* @since 1.8
*/
@Slf4j
...
...
@@ -67,6 +66,7 @@ public abstract class AuthDefaultRequest implements AuthRequest {
* 建议使用{@link AuthDefaultRequest#authorize(String)}方法生成授权地址,在回调方法中对{@code state}进行校验
*
* @return 返回授权地址
* @see AuthDefaultRequest#authorize(String)
*/
@Deprecated
@Override
...
...
@@ -79,6 +79,7 @@ public abstract class AuthDefaultRequest implements AuthRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
@@ -178,6 +179,7 @@ public abstract class AuthDefaultRequest implements AuthRequest {
* @param authToken token封装
* @return HttpResponse
*/
@Deprecated
protected
HttpResponse
doPostUserInfo
(
AuthToken
authToken
)
{
return
HttpRequest
.
post
(
userInfoUrl
(
authToken
)).
execute
();
}
...
...
@@ -197,7 +199,9 @@ public abstract class AuthDefaultRequest implements AuthRequest {
*
* @param authToken token封装
* @return HttpResponse
* @since
*/
@Deprecated
protected
HttpResponse
doPostRevoke
(
AuthToken
authToken
)
{
return
HttpRequest
.
post
(
revokeUrl
(
authToken
)).
execute
();
}
...
...
src/main/java/me/zhyd/oauth/request/AuthDingTalkRequest.java
浏览文件 @
64aa1940
...
...
@@ -18,7 +18,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 钉钉登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthDingTalkRequest
extends
AuthDefaultRequest
{
...
...
@@ -62,6 +61,7 @@ public class AuthDingTalkRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthDouyinRequest.java
浏览文件 @
64aa1940
...
...
@@ -15,7 +15,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 抖音登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthDouyinRequest
extends
AuthDefaultRequest
{
...
...
@@ -93,6 +92,7 @@ public class AuthDouyinRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthFacebookRequest.java
浏览文件 @
64aa1940
...
...
@@ -15,7 +15,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* Facebook登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthFacebookRequest
extends
AuthDefaultRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java
浏览文件 @
64aa1940
...
...
@@ -14,7 +14,6 @@ import me.zhyd.oauth.model.AuthUser;
* Gitee登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthGiteeRequest
extends
AuthDefaultRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthGithubRequest.java
浏览文件 @
64aa1940
...
...
@@ -17,7 +17,6 @@ import java.util.Map;
* Github登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthGithubRequest
extends
AuthDefaultRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthGoogleRequest.java
浏览文件 @
64aa1940
...
...
@@ -16,7 +16,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* Google登录
*
* @author yangkai.shen (https://xkcoding.com)
* @version 1.3
* @since 1.3
*/
public
class
AuthGoogleRequest
extends
AuthDefaultRequest
{
...
...
@@ -65,6 +64,7 @@ public class AuthGoogleRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthLinkedinRequest.java
浏览文件 @
64aa1940
...
...
@@ -18,7 +18,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 领英登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthLinkedinRequest
extends
AuthDefaultRequest
{
...
...
@@ -186,6 +185,7 @@ public class AuthLinkedinRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthMiRequest.java
浏览文件 @
64aa1940
...
...
@@ -18,7 +18,6 @@ import java.text.MessageFormat;
* 小米登录
*
* @author yangkai.shen (https://xkcoding.com)
* @version 1.5
* @since 1.5
*/
@Slf4j
...
...
@@ -113,6 +112,7 @@ public class AuthMiRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthMicrosoftRequest.java
浏览文件 @
64aa1940
...
...
@@ -16,7 +16,6 @@ import static me.zhyd.oauth.utils.GlobalAuthUtil.parseQueryToMap;
* 微软登录
*
* @author yangkai.shen (https://xkcoding.com)
* @version 1.5
* @since 1.5
*/
public
class
AuthMicrosoftRequest
extends
AuthDefaultRequest
{
...
...
@@ -106,6 +105,7 @@ public class AuthMicrosoftRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthOschinaRequest.java
浏览文件 @
64aa1940
...
...
@@ -15,7 +15,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* oschina登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthOschinaRequest
extends
AuthDefaultRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthPinterestRequest.java
浏览文件 @
64aa1940
...
...
@@ -19,7 +19,6 @@ import static me.zhyd.oauth.config.AuthSource.PINTEREST;
* Pinterest登录
*
* @author hongwei.peng (pengisgood(at)gmail(dot)com)
* @version 1.9.0
* @since 1.8
*/
public
class
AuthPinterestRequest
extends
AuthDefaultRequest
{
...
...
@@ -74,6 +73,7 @@ public class AuthPinterestRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthQqRequest.java
浏览文件 @
64aa1940
...
...
@@ -20,7 +20,6 @@ import java.util.Map;
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @author yangkai.shen (https://xkcoding.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthQqRequest
extends
AuthDefaultRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthRenrenRequest.java
浏览文件 @
64aa1940
...
...
@@ -19,7 +19,6 @@ import static me.zhyd.oauth.model.AuthResponseStatus.SUCCESS;
* 人人登录
*
* @author hongwei.peng (pengisgood(at)gmail(dot)com)
* @version 1.9.0
* @since 1.8
*/
public
class
AuthRenrenRequest
extends
AuthDefaultRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthRequest.java
浏览文件 @
64aa1940
...
...
@@ -8,7 +8,6 @@ import me.zhyd.oauth.model.AuthToken;
/**
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
interface
AuthRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthStackOverflowRequest.java
浏览文件 @
64aa1940
...
...
@@ -18,7 +18,6 @@ import static me.zhyd.oauth.utils.GlobalAuthUtil.parseQueryToMap;
* Stack Overflow登录
*
* @author hongwei.peng (pengisgood(at)gmail(dot)com)
* @version 1.9.0
* @since 1.8
*/
public
class
AuthStackOverflowRequest
extends
AuthDefaultRequest
{
...
...
@@ -72,6 +71,7 @@ public class AuthStackOverflowRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthTaobaoRequest.java
浏览文件 @
64aa1940
...
...
@@ -16,7 +16,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 淘宝登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthTaobaoRequest
extends
AuthDefaultRequest
{
...
...
@@ -59,6 +58,7 @@ public class AuthTaobaoRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthTeambitionRequest.java
浏览文件 @
64aa1940
...
...
@@ -13,7 +13,6 @@ import me.zhyd.oauth.model.*;
* Teambition授权登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthTeambitionRequest
extends
AuthDefaultRequest
{
...
...
src/main/java/me/zhyd/oauth/request/AuthTencentCloudRequest.java
浏览文件 @
64aa1940
...
...
@@ -15,7 +15,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 腾讯云登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthTencentCloudRequest
extends
AuthDefaultRequest
{
...
...
@@ -75,6 +74,7 @@ public class AuthTencentCloudRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthToutiaoRequest.java
浏览文件 @
64aa1940
...
...
@@ -16,7 +16,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 今日头条登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.5
* @since 1.5
*/
public
class
AuthToutiaoRequest
extends
AuthDefaultRequest
{
...
...
@@ -69,6 +68,7 @@ public class AuthToutiaoRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthWeChatRequest.java
浏览文件 @
64aa1940
...
...
@@ -14,7 +14,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 微信登录
*
* @author yangkai.shen (https://xkcoding.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthWeChatRequest
extends
AuthDefaultRequest
{
...
...
@@ -104,6 +103,7 @@ public class AuthWeChatRequest extends AuthDefaultRequest {
*
* @param state state 验证授权流程的参数,可以防止csrf
* @return 返回授权地址
* @since 1.9.3
*/
@Override
public
String
authorize
(
String
state
)
{
...
...
src/main/java/me/zhyd/oauth/request/AuthWeiboRequest.java
浏览文件 @
64aa1940
...
...
@@ -19,7 +19,6 @@ import me.zhyd.oauth.utils.UrlBuilder;
* 微博登录
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthWeiboRequest
extends
AuthDefaultRequest
{
...
...
@@ -51,7 +50,7 @@ public class AuthWeiboRequest extends AuthDefaultRequest {
String
oauthParam
=
String
.
format
(
"uid=%s&access_token=%s"
,
uid
,
accessToken
);
HttpResponse
response
=
HttpRequest
.
get
(
userInfoUrl
(
authToken
))
.
header
(
"Authorization"
,
"OAuth2 "
+
oauthParam
)
.
header
(
"API-RemoteIP"
,
IpUtils
.
getIp
())
.
header
(
"API-RemoteIP"
,
IpUtils
.
get
Local
Ip
())
.
execute
();
String
userInfo
=
response
.
body
();
JSONObject
object
=
JSONObject
.
parseObject
(
userInfo
);
...
...
src/main/java/me/zhyd/oauth/utils/AuthChecker.java
浏览文件 @
64aa1940
...
...
@@ -9,7 +9,6 @@ import me.zhyd.oauth.model.AuthResponseStatus;
* 授权配置类的校验器
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthChecker
{
...
...
src/main/java/me/zhyd/oauth/utils/GlobalAuthUtil.java
浏览文件 @
64aa1940
...
...
@@ -21,7 +21,6 @@ import java.util.*;
* 全局的工具类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
GlobalAuthUtil
{
...
...
src/main/java/me/zhyd/oauth/utils/IpUtils.java
浏览文件 @
64aa1940
...
...
@@ -7,7 +7,6 @@ import java.net.UnknownHostException;
* 获取IP的工具类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.0
*/
public
class
IpUtils
{
...
...
@@ -17,7 +16,7 @@ public class IpUtils {
*
* @return ip
*/
public
static
String
getIp
()
{
public
static
String
get
Local
Ip
()
{
try
{
return
InetAddress
.
getLocalHost
().
getHostAddress
();
}
catch
(
UnknownHostException
e
)
{
...
...
@@ -25,4 +24,4 @@ public class IpUtils {
return
null
;
}
}
}
\ No newline at end of file
}
src/main/java/me/zhyd/oauth/utils/UrlBuilder.java
浏览文件 @
64aa1940
...
...
@@ -14,7 +14,6 @@ import java.util.Map;
* </p>
*
* @author yangkai.shen (https://xkcoding.com)
* @version 1.0
* @since 1.8
*/
@Setter
...
...
src/test/java/me/zhyd/oauth/AuthRequestTest.java
浏览文件 @
64aa1940
...
...
@@ -8,7 +8,6 @@ import org.junit.Test;
/**
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public
class
AuthRequestTest
{
...
...
src/test/java/me/zhyd/oauth/utils/CustomTest.java
浏览文件 @
64aa1940
...
...
@@ -13,9 +13,6 @@ import java.util.Map;
/**
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @website https://www.zhyd.me
* @date 2019/7/19 15:52
* @since 1.8
*/
public
class
CustomTest
{
...
...
update.md
浏览文件 @
64aa1940
### 2019/07/27
1.
`IpUtils.getIp`
改名为
`IpUtils.getLocalIp`
2.
规范注释
### 2019/07/25
1.
`AuthConfig`
类中去掉state参数
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录