diff --git a/pom.xml b/pom.xml
index 1606b68..6eb997f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,8 +42,10 @@
tigon-mybatis-cache-redis
tigon-shiro-cache
tigon-shiro-cache-redis
- tigon-web
tigon-shiro-core
+ tigon-shiro-cas
+ tigon-shiro
+ tigon-web
tigon-service-api
tigon-service-support
tigon-extjs
@@ -82,21 +84,31 @@
tigon-mybatis-cache-redis
${project.version}
-
- me.chyxion.tigon
- tigon-shiro-cache-redis
- ${project.version}
-
me.chyxion.tigon
tigon-shiro-cache
${project.version}
+
+ me.chyxion.tigon
+ tigon-shiro-cache-redis
+ ${project.version}
+
me.chyxion.tigon
tigon-shiro-core
${project.version}
+
+ me.chyxion.tigon
+ tigon-shiro
+ ${project.version}
+
+
+ me.chyxion.tigon
+ tigon-shiro-cas
+ ${project.version}
+
me.chyxion.tigon
tigon-service-api
diff --git a/tigon-shiro-cache/pom.xml b/tigon-shiro-cache/pom.xml
index b5fbfc2..6e12499 100644
--- a/tigon-shiro-cache/pom.xml
+++ b/tigon-shiro-cache/pom.xml
@@ -35,10 +35,10 @@
shiro-core
1.3.2
-
- org.springframework.data
- spring-data-redis
-
+
+
+
+
org.projectlombok
diff --git a/tigon-shiro-cache/src/main/java/me/chyxion/tigon/shiro/cache/SessionCache.java b/tigon-shiro-cache/src/main/java/me/chyxion/tigon/shiro/cache/SessionCache.java
index 6da3e8e..220273f 100644
--- a/tigon-shiro-cache/src/main/java/me/chyxion/tigon/shiro/cache/SessionCache.java
+++ b/tigon-shiro-cache/src/main/java/me/chyxion/tigon/shiro/cache/SessionCache.java
@@ -4,7 +4,7 @@ import java.io.Serializable;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.session.Session;
import javax.validation.constraints.NotNull;
-import org.hibernate.validator.constraints.NotBlank;
+import javax.validation.constraints.NotBlank;
import org.springframework.validation.annotation.Validated;
/**
diff --git a/tigon-shiro-cas/.gitignore b/tigon-shiro-cas/.gitignore
new file mode 100644
index 0000000..bcb9203
--- /dev/null
+++ b/tigon-shiro-cas/.gitignore
@@ -0,0 +1,9 @@
+.*
+!.gitignore
+!.gitkeep
+*.iml
+**/src/main/resources/application.properties
+**/src/main/resources/log4j2.xml
+**/src/main/resources/logback.xml
+target/
+bin/
diff --git a/tigon-shiro-cas/README.md b/tigon-shiro-cas/README.md
new file mode 100644
index 0000000..77cd973
--- /dev/null
+++ b/tigon-shiro-cas/README.md
@@ -0,0 +1 @@
+# CAS Client Shiro
diff --git a/tigon-shiro-cas/pom.xml b/tigon-shiro-cas/pom.xml
new file mode 100644
index 0000000..eb6446c
--- /dev/null
+++ b/tigon-shiro-cas/pom.xml
@@ -0,0 +1,50 @@
+
+
+ 4.0.0
+ tigon-shiro-cas
+ jar
+ CAS Client Shiro
+ CAS Client Shiro
+
+
+ me.chyxion.tigon
+ tigon
+ 0.0.1-SNAPSHOT
+ ../
+
+
+
+
+ me.chyxion.tigon
+ tigon-shiro-core
+
+
+ org.apache.shiro
+ shiro-spring
+ 1.4.0
+
+
+ org.pac4j
+ pac4j-cas
+ 2.3.1
+
+
+ io.buji
+ buji-pac4j
+ 3.2.0
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
diff --git a/tigon-shiro-cas/src/main/java/me/chyxion/tigon/shiro/cas/DefaultProfileCreator.java b/tigon-shiro-cas/src/main/java/me/chyxion/tigon/shiro/cas/DefaultProfileCreator.java
new file mode 100644
index 0000000..ff55085
--- /dev/null
+++ b/tigon-shiro-cas/src/main/java/me/chyxion/tigon/shiro/cas/DefaultProfileCreator.java
@@ -0,0 +1,57 @@
+package me.chyxion.tigon.shiro.cas;
+
+import java.util.Map;
+import java.util.Collection;
+import lombok.extern.slf4j.Slf4j;
+import java.util.function.Consumer;
+import org.pac4j.core.context.WebContext;
+import org.pac4j.core.profile.CommonProfile;
+import org.pac4j.core.credentials.TokenCredentials;
+import org.pac4j.core.profile.creator.ProfileCreator;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @author Shaun Chyxion
+ * chyxion@163.com
+ * Jun 23, 2018 16:17:53
+ */
+@Slf4j
+public class DefaultProfileCreator implements ProfileCreator {
+
+ @Autowired(required = false)
+ private UserProfileProvider userProfileProvider;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public CommonProfile create(final TokenCredentials credentials, final WebContext context) {
+ log.debug("Create user profile from credentials [{}].", credentials);
+
+ final CommonProfile userProfile = credentials.getUserProfile();
+ if (userProfileProvider != null) {
+ log.debug("User profile provider [{}] found.", userProfileProvider);
+ final UserProfileProvider.UserProfile userProfileResult =
+ userProfileProvider.getUserProfile(userProfile.getId());
+ if (userProfileResult != null) {
+ applyIfNotEmpty(userProfileResult.getRoles(), userProfile::addRoles);
+ applyIfNotEmpty(userProfileResult.getPermissions(), userProfile::addPermissions);
+ applyIfNotEmpty(userProfileResult.getAttrs(), userProfile::addAttributes);
+ applyIfNotEmpty(userProfileResult.getAuthAttrs(), userProfile::addAuthenticationAttributes);
+ }
+ }
+ return userProfile;
+ }
+
+ private void applyIfNotEmpty(final Collection data, final Consumer> consumer) {
+ if (data != null && !data.isEmpty()) {
+ consumer.accept(data);
+ }
+ }
+
+ private void applyIfNotEmpty(final Map data, final Consumer