Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
3820874b
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3820874b
编写于
11月 19, 2021
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TENCENT_IOA
上级
d6eaae24
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
40 addition
and
8 deletion
+40
-8
maxkey-core/src/main/java/org/maxkey/web/WebXssRequestFilter.java
...ore/src/main/java/org/maxkey/web/WebXssRequestFilter.java
+2
-0
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/common/OAuth2Constants.java
.../java/org/maxkey/authz/oauth2/common/OAuth2Constants.java
+3
-0
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/endpoint/AuthorizationEndpoint.java
...authz/oauth2/provider/endpoint/AuthorizationEndpoint.java
+14
-4
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/endpoint/TokenEndpoint.java
.../maxkey/authz/oauth2/provider/endpoint/TokenEndpoint.java
+10
-2
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/endpoint/TokenEndpointAuthenticationFilter.java
.../provider/endpoint/TokenEndpointAuthenticationFilter.java
+4
-1
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/autoconfigure/Oauth20AutoConfiguration.java
...va/org/maxkey/autoconfigure/Oauth20AutoConfiguration.java
+3
-1
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyMvcConfig.java
...-web-maxkey/src/main/java/org/maxkey/MaxKeyMvcConfig.java
+4
-0
未找到文件。
maxkey-core/src/main/java/org/maxkey/web/WebXssRequestFilter.java
浏览文件 @
3820874b
...
...
@@ -45,6 +45,8 @@ public class WebXssRequestFilter extends GenericFilterBean {
skipUrlMap
.
put
(
"/authz/cas/"
,
"/authz/cas/"
);
skipUrlMap
.
put
(
"/authz/cas/login"
,
"/authz/cas/login"
);
skipUrlMap
.
put
(
"/authz/oauth/v20/authorize"
,
"/authz/oauth/v20/authorize"
);
//TENCENT_IOA
skipUrlMap
.
put
(
"/oauth2/authorize"
,
"/oauth2/authorize"
);
}
@Override
...
...
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/common/OAuth2Constants.java
浏览文件 @
3820874b
...
...
@@ -124,5 +124,8 @@ public class OAuth2Constants {
public
final
static
String
ENDPOINT_OPENID_CONNECT_USERINFO
=
"/api/connect/v10/userinfo"
;
public
final
static
String
ENDPOINT_TENCENT_IOA_AUTHORIZE
=
"/oauth2/authorize"
;
public
final
static
String
ENDPOINT_TENCENT_IOA_TOKEN
=
"/oauth2/token"
;
}
}
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/endpoint/AuthorizationEndpoint.java
浏览文件 @
3820874b
...
...
@@ -136,7 +136,11 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
}
@ApiOperation
(
value
=
"OAuth 2.0 认证接口"
,
notes
=
"传递参数client_id,response_type,redirect_uri等"
,
httpMethod
=
"GET"
)
@RequestMapping
(
value
=
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_AUTHORIZE
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
{
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_AUTHORIZE
,
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TENCENT_IOA_AUTHORIZE
},
method
=
RequestMethod
.
GET
)
public
ModelAndView
authorize
(
Map
<
String
,
Object
>
model
,
@RequestParam
Map
<
String
,
String
>
parameters
,
...
...
@@ -225,7 +229,9 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
}
//approval must post
@RequestMapping
(
value
=
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_AUTHORIZE
,
method
=
RequestMethod
.
POST
,
params
=
OAuth2Constants
.
PARAMETER
.
USER_OAUTH_APPROVAL
)
@RequestMapping
(
value
=
{
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_AUTHORIZE
},
params
=
OAuth2Constants
.
PARAMETER
.
USER_OAUTH_APPROVAL
,
method
=
RequestMethod
.
POST
)
public
View
approveOrDeny
(
@RequestParam
Map
<
String
,
String
>
approvalParameters
,
Map
<
String
,
?>
model
,
...
...
@@ -334,8 +340,12 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
// Authorization Code Response
private
View
getAuthorizationCodeResponse
(
AuthorizationRequest
authorizationRequest
,
Authentication
authUser
)
{
try
{
return
new
RedirectView
(
getSuccessfulRedirect
(
authorizationRequest
,
generateCode
(
authorizationRequest
,
authUser
)),
false
,
true
,
false
);
String
successfulRedirect
=
getSuccessfulRedirect
(
authorizationRequest
,
generateCode
(
authorizationRequest
,
authUser
)
);
_logger
.
debug
(
"successfulRedirect "
+
successfulRedirect
);
return
new
RedirectView
(
successfulRedirect
,
false
,
true
,
false
);
}
catch
(
OAuth2Exception
e
)
{
return
new
RedirectView
(
getUnsuccessfulRedirect
(
authorizationRequest
,
e
,
false
),
false
,
true
,
false
);
...
...
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/endpoint/TokenEndpoint.java
浏览文件 @
3820874b
...
...
@@ -90,7 +90,11 @@ public class TokenEndpoint extends AbstractEndpoint {
* @throws HttpRequestMethodNotSupportedException
*/
@ApiOperation
(
value
=
"OAuth 2.0 获取AccessToken接口"
,
notes
=
"传递参数token等"
,
httpMethod
=
"GET"
)
@RequestMapping
(
value
=
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
{
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
,
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TENCENT_IOA_TOKEN
},
method
=
RequestMethod
.
GET
)
public
ResponseEntity
<
OAuth2AccessToken
>
getAccessToken
(
@RequestParam
Map
<
String
,
String
>
parameters
)
throws
HttpRequestMethodNotSupportedException
{
if
(!
allowedRequestMethods
.
contains
(
HttpMethod
.
GET
))
{
...
...
@@ -100,7 +104,11 @@ public class TokenEndpoint extends AbstractEndpoint {
}
@ApiOperation
(
value
=
"OAuth 2.0 获取AccessToken接口"
,
notes
=
"传递参数token等"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
{
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
,
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TENCENT_IOA_TOKEN
},
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
OAuth2AccessToken
>
postAccessToken
(
@RequestParam
Map
<
String
,
String
>
parameters
)
throws
HttpRequestMethodNotSupportedException
{
// TokenEndpointAuthenticationFilter
...
...
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/endpoint/TokenEndpointAuthenticationFilter.java
浏览文件 @
3820874b
...
...
@@ -78,7 +78,10 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
* @author Dave Syer
*
*/
@WebFilter
(
filterName
=
"TokenEndpointAuthenticationFilter"
,
urlPatterns
=
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
+
"/*"
)
@WebFilter
(
filterName
=
"TokenEndpointAuthenticationFilter"
,
urlPatterns
=
{
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
+
"/*"
,
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TENCENT_IOA_TOKEN
+
"/*"
})
public
class
TokenEndpointAuthenticationFilter
implements
Filter
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
TokenEndpointAuthenticationFilter
.
class
);
...
...
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/autoconfigure/Oauth20AutoConfiguration.java
浏览文件 @
3820874b
...
...
@@ -76,7 +76,9 @@ public class Oauth20AutoConfiguration implements InitializingBean {
_logger
.
debug
(
"TokenEndpointAuthenticationFilter init "
);
FilterRegistrationBean
<
Filter
>
registration
=
new
FilterRegistrationBean
<
Filter
>();
registration
.
setFilter
(
new
TokenEndpointAuthenticationFilter
());
registration
.
addUrlPatterns
(
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
+
"/*"
);
registration
.
addUrlPatterns
(
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TOKEN
+
"/*"
,
OAuth2Constants
.
ENDPOINT
.
ENDPOINT_TENCENT_IOA_TOKEN
+
"/*"
);
registration
.
setName
(
"TokenEndpointAuthenticationFilter"
);
registration
.
setOrder
(
1
);
return
registration
;
...
...
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyMvcConfig.java
浏览文件 @
3820874b
...
...
@@ -185,6 +185,10 @@ public class MaxKeyMvcConfig implements WebMvcConfigurer {
.
addPathPatterns
(
"/authz/oauth/v20/authorize"
)
.
addPathPatterns
(
"/authz/oauth/v20/authorize/*"
)
//OAuth TENCENT_IOA
.
addPathPatterns
(
"/oauth2/authorize"
)
.
addPathPatterns
(
"/oauth2/authorize/*"
)
//online ticket Validate
.
excludePathPatterns
(
"/onlineticket/ticketValidate"
)
.
excludePathPatterns
(
"/onlineticket/ticketValidate/*"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录