diff --git a/sa-token-demo/sa-token-demo-solon-redisson/pom.xml b/sa-token-demo/sa-token-demo-solon-redisson/pom.xml index c08a7b8d..d60eb51e 100644 --- a/sa-token-demo/sa-token-demo-solon-redisson/pom.xml +++ b/sa-token-demo/sa-token-demo-solon-redisson/pom.xml @@ -10,7 +10,7 @@ org.noear solon-parent - 2.4.0 + 2.7.0 diff --git a/sa-token-demo/sa-token-demo-solon/pom.xml b/sa-token-demo/sa-token-demo-solon/pom.xml index 01b44aa5..075101d1 100644 --- a/sa-token-demo/sa-token-demo-solon/pom.xml +++ b/sa-token-demo/sa-token-demo-solon/pom.xml @@ -10,7 +10,7 @@ org.noear solon-parent - 2.4.0 + 2.7.0 diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/pom.xml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/pom.xml index a5df50ba..b08a1f46 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/pom.xml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/pom.xml @@ -10,14 +10,13 @@ org.noear solon-parent - 2.4.0 + 2.7.0 1.38.0 - 2.2.3 diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/java/com/pj/sso/SsoConfig.java b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/java/com/pj/sso/SsoConfig.java index a2618dcc..0094cac4 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/java/com/pj/sso/SsoConfig.java +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/java/com/pj/sso/SsoConfig.java @@ -21,7 +21,7 @@ public class SsoConfig { * 构建建 SaToken redis dao(如果不需要 redis;可以注释掉) * */ @Bean - public SaTokenDao saTokenDaoInit(@Inject("${sa-token.redis}") SaTokenDaoOfRedis saTokenDao) { + public SaTokenDao saTokenDaoInit(@Inject("${sa-token.dao.redis}") SaTokenDaoOfRedis saTokenDao) { return saTokenDao; } diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/resources/app.yml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/resources/app.yml index 2fde61a4..af035ff6 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/resources/app.yml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso-server-solon/src/main/resources/app.yml @@ -26,7 +26,7 @@ sa-token: secret-key: kQwIOrYvnXmSDkwEiFngrKidMcdrgKor # ---- 除了以上配置项,你还需要为 Sa-Token 配置http请求处理器(文档有步骤说明) -sa-token: #名字可以随意取 +sa-token.dao: #名字可以随意取 redis: server: "localhost:6379" password: 123456 diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/pom.xml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/pom.xml index b98ecd47..0437b6fe 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/pom.xml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/pom.xml @@ -10,7 +10,7 @@ org.noear solon-parent - 2.4.0 + 2.7.0 diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/java/com/pj/SaConfig.java b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/java/com/pj/SaConfig.java index 7bdd8aba..6031f505 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/java/com/pj/SaConfig.java +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/java/com/pj/SaConfig.java @@ -16,7 +16,7 @@ public class SaConfig { * 配置 Sa-Token 单独使用的Redis连接 (此处需要和SSO-Server端连接同一个Redis) * */ @Bean - public SaTokenDao saTokenDaoInit(@Inject("${sa-token.redis}") SaTokenDaoOfRedis saTokenDao) { + public SaTokenDao saTokenDaoInit(@Inject("${sa-token.dao.redis}") SaTokenDaoOfRedis saTokenDao) { return saTokenDao; } } diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/resources/app.yml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/resources/app.yml index 04730349..b0887401 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/resources/app.yml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso1-client-solon/src/main/resources/app.yml @@ -12,7 +12,7 @@ sa-token: slo-url: http://sso.stp.com:9000/sso/signout # 配置 Sa-Token 单独使用的Redis连接 (此处需要和SSO-Server端连接同一个Redis) -sa-token: #名字可以随意取 +sa-token.dao: #名字可以随意取 redis: server: "localhost:6379" password: 123456 diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/pom.xml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/pom.xml index 8ae7b7d4..a7dc10c9 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/pom.xml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/pom.xml @@ -10,7 +10,7 @@ org.noear solon-parent - 2.4.0 + 2.7.0 diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/java/com/pj/SaConfig.java b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/java/com/pj/SaConfig.java index 7bdd8aba..6031f505 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/java/com/pj/SaConfig.java +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/java/com/pj/SaConfig.java @@ -16,7 +16,7 @@ public class SaConfig { * 配置 Sa-Token 单独使用的Redis连接 (此处需要和SSO-Server端连接同一个Redis) * */ @Bean - public SaTokenDao saTokenDaoInit(@Inject("${sa-token.redis}") SaTokenDaoOfRedis saTokenDao) { + public SaTokenDao saTokenDaoInit(@Inject("${sa-token.dao.redis}") SaTokenDaoOfRedis saTokenDao) { return saTokenDao; } } diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/resources/app.yml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/resources/app.yml index 2a4e01ab..d509817c 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/resources/app.yml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso2-client-solon/src/main/resources/app.yml @@ -1,6 +1,6 @@ # 端口 server: - port: 9001 + port: 9002 # sa-token配置 sa-token: @@ -13,7 +13,7 @@ sa-token: is-slo: true # 配置 Sa-Token 单独使用的Redis连接 (此处需要和SSO-Server端连接同一个Redis) -sa-token: #名字可以随意取 +sa-token.dao: #名字可以随意取 redis: server: "localhost:6379" password: 123456 diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/pom.xml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/pom.xml index 2750f9cd..17b2d5c2 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/pom.xml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/pom.xml @@ -10,7 +10,7 @@ org.noear solon-parent - 2.4.0 + 2.7.0 @@ -26,6 +26,12 @@ org.noear solon-api + + + + org.noear + forest-solon-plugin + @@ -47,15 +53,7 @@ sa-token-redisx ${sa-token.version} - - - - com.dtflys.forest - forest-solon-plugin - 1.5.29 - - - + diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/java/com/pj/SaConfig.java b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/java/com/pj/SaConfig.java index e02d3be5..590f69f1 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/java/com/pj/SaConfig.java +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/java/com/pj/SaConfig.java @@ -16,7 +16,7 @@ public class SaConfig { * 构建建 SaToken redis dao(如果不需要 redis;可以注释掉) * */ @Bean - public SaTokenDao saTokenDaoInit(@Inject("${sa-token.redis}") SaTokenDaoOfRedis saTokenDao) { + public SaTokenDao saTokenDaoInit(@Inject("${sa-token.dao.redis}") SaTokenDaoOfRedis saTokenDao) { return saTokenDao; } } diff --git a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/resources/app.yml b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/resources/app.yml index dff9616b..b64d298c 100644 --- a/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/resources/app.yml +++ b/sa-token-demo/sa-token-demo-sso-for-solon/sa-token-demo-sso3-client-solon/src/main/resources/app.yml @@ -1,6 +1,6 @@ # 端口 server: - port: 9001 + port: 9003 # sa-token配置 sa-token: @@ -23,7 +23,7 @@ sa-token: # 配置 Sa-Token Dao(此处与SSO-Server端连接不同的Redis) -sa-token: #名字可以随意取 +sa-token.dao: #名字可以随意取 redis: server: "localhost:6379" password: 123456 diff --git a/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/oauth2/SaOAuth2AutoConfigure.java b/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/oauth2/SaOAuth2AutoConfigure.java index 42c3cc3e..0b01e86e 100644 --- a/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/oauth2/SaOAuth2AutoConfigure.java +++ b/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/oauth2/SaOAuth2AutoConfigure.java @@ -24,7 +24,6 @@ import org.noear.solon.annotation.Condition; import org.noear.solon.annotation.Configuration; import org.noear.solon.annotation.Inject; import org.noear.solon.core.AppContext; -import org.noear.solon.core.bean.InitializingBean; /** * @author noear @@ -33,12 +32,9 @@ import org.noear.solon.core.bean.InitializingBean; @Condition(onClass = SaOAuth2Manager.class) @Configuration -public class SaOAuth2AutoConfigure implements InitializingBean { - @Inject - private AppContext appContext; - - @Override - public void afterInjection() throws Throwable { +public class SaOAuth2AutoConfigure { + @Bean + public void init(AppContext appContext) throws Throwable { appContext.subBeansOfType(SaOAuth2Template.class, bean -> { SaOAuth2Util.saOAuth2Template = bean; }); diff --git a/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/sso/SaSsoAutoConfigure.java b/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/sso/SaSsoAutoConfigure.java index 4b40bada..171ddfc0 100644 --- a/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/sso/SaSsoAutoConfigure.java +++ b/sa-token-starter/sa-token-solon-plugin/src/main/java/cn/dev33/satoken/solon/sso/SaSsoAutoConfigure.java @@ -36,39 +36,37 @@ import org.noear.solon.core.bean.InitializingBean; @Condition(onClass = SaSsoManager.class) @Configuration -public class SaSsoAutoConfigure implements InitializingBean { - @Inject - private AppContext appContext; - - @Override - public void afterInjection() throws Throwable { - appContext.subBeansOfType(SaSsoServerTemplate.class, bean->{ +public class SaSsoAutoConfigure { + @Bean + public void init(AppContext appContext) throws Throwable { + appContext.subBeansOfType(SaSsoServerTemplate.class, bean -> { SaSsoServerProcessor.instance.ssoServerTemplate = bean; }); - appContext.subBeansOfType(SaSsoClientTemplate.class, bean->{ + appContext.subBeansOfType(SaSsoClientTemplate.class, bean -> { SaSsoClientProcessor.instance.ssoClientTemplate = bean; }); - appContext.subBeansOfType(SaSsoServerConfig.class, bean->{ + appContext.subBeansOfType(SaSsoServerConfig.class, bean -> { SaSsoManager.setServerConfig(bean); }); - appContext.subBeansOfType(SaSsoClientConfig.class, bean->{ + appContext.subBeansOfType(SaSsoClientConfig.class, bean -> { SaSsoManager.setClientConfig(bean); }); } /** * 获取 SSO Server 配置Bean - * */ + */ @Bean - public SaSsoServerConfig getConfig(@Inject(value = "${sa-token.sso-server}",required = false) SaSsoServerConfig ssoConfig) { + public SaSsoServerConfig getConfig(@Inject(value = "${sa-token.sso-server}", required = false) SaSsoServerConfig ssoConfig) { return ssoConfig; } + /** * 获取 SSO Client 配置Bean - * */ + */ @Bean - public SaSsoClientConfig getClientConfig(@Inject(value = "${sa-token.sso-client}",required = false) SaSsoClientConfig ssoConfig) { + public SaSsoClientConfig getClientConfig(@Inject(value = "${sa-token.sso-client}", required = false) SaSsoClientConfig ssoConfig) { return ssoConfig; } } \ No newline at end of file