-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...ent-demo/src/main/java/com/carl/auth/sso/client/demo/SimpleUrlPatternMatcherStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 版权所有.(c)2008-2017. 卡尔科技工作室 | ||
*/ | ||
|
||
package com.carl.auth.sso.client.demo; | ||
|
||
import org.jasig.cas.client.authentication.UrlPatternMatcherStrategy; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* @author Carl | ||
* @date 2017/9/28 | ||
* @since 1.5.0 | ||
*/ | ||
public class SimpleUrlPatternMatcherStrategy implements UrlPatternMatcherStrategy { | ||
protected final Logger logger = LoggerFactory.getLogger(getClass()); | ||
|
||
@Override | ||
public boolean matches(String url) { | ||
logger.debug("访问路径:" + url); | ||
return url.contains("zhangsan.jsp"); | ||
} | ||
|
||
@Override | ||
public void setPattern(String pattern) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
sso-client-demo/sso-cas-client-demo/src/main/webapp/wangwu.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<%-- | ||
~ 版权所有.(c)2008-2017. 卡尔科技工作室 | ||
--%> | ||
|
||
|
||
|
||
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
<html> | ||
<head> | ||
<title>王五</title> | ||
</head> | ||
<body> | ||
需要登录才访问 | ||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
sso-client-demo/sso-cas-client-demo/src/main/webapp/zhangsan.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<%-- | ||
~ 版权所有.(c)2008-2017. 卡尔科技工作室 | ||
--%> | ||
|
||
|
||
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
<html> | ||
<head> | ||
<title>张三</title> | ||
</head> | ||
<body> | ||
可以不登录就访问 | ||
</body> | ||
</html> |
6 changes: 3 additions & 3 deletions
6
sso-server/src/main/resources/services/Localhost-10000002.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"@class": "org.apereo.cas.services.RegexRegisteredService", | ||
"serviceId": "^(http)://localhost.*", | ||
"name": "本地服务", | ||
"serviceId": "^(http|https)://localhost.*", | ||
"name": "Local Services", | ||
"id": 10000002, | ||
"description": "这是一个本地允许的服务,通过localhost访问都允许通过", | ||
"description": "this is a localhost service,all of can login", | ||
"evaluationOrder": 10000000 | ||
} |