diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/OAuth2Granter.java b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/OAuth2Granter.java index 478349db2..371126370 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/OAuth2Granter.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/OAuth2Granter.java @@ -22,8 +22,6 @@ import org.hswebframework.web.authorization.oauth2.server.TokenRequest; import org.hswebframework.web.authorization.oauth2.server.OAuth2AccessToken; /** - * TODO 完成注释 - * * @author zhouhao */ public interface OAuth2Granter { diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/DefaultImplicitGranter.java b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/DefaultImplicitGranter.java index c2488f46f..53f7424f0 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/DefaultImplicitGranter.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/DefaultImplicitGranter.java @@ -34,8 +34,6 @@ import java.util.Set; import static org.hswebframework.web.oauth2.core.ErrorType.*; /** - * TODO 完成注释 - * * @author zhouhao */ public class DefaultImplicitGranter extends AbstractAuthorizationService implements ImplicitGranter { diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/ImplicitRequest.java b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/ImplicitRequest.java index 7d829da69..7939def4e 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/ImplicitRequest.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/ImplicitRequest.java @@ -23,8 +23,6 @@ import org.hswebframework.web.authorization.oauth2.server.TokenRequest; import java.util.Set; /** - * TODO 完成注释 - * * @author zhouhao */ public interface ImplicitRequest extends TokenRequest { diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/password/DefaultPasswordGranter.java b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/password/DefaultPasswordGranter.java index 1b3ce97dd..c1bb84a67 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/password/DefaultPasswordGranter.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/password/DefaultPasswordGranter.java @@ -31,8 +31,6 @@ import java.util.Set; import static org.hswebframework.web.oauth2.core.ErrorType.*; /** - * TODO 完成注释 - * * @author zhouhao */ public class DefaultPasswordGranter extends AbstractAuthorizationService implements PasswordGranter { diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/DefaultRefreshTokenGranter.java b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/DefaultRefreshTokenGranter.java index 411a6963b..d3b513fcd 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/DefaultRefreshTokenGranter.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/DefaultRefreshTokenGranter.java @@ -34,8 +34,6 @@ import java.util.Set; import static org.hswebframework.web.oauth2.core.ErrorType.*; /** - * TODO 完成注释 - * * @author zhouhao */ public class DefaultRefreshTokenGranter extends AbstractAuthorizationService implements RefreshTokenGranter { diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/RefreshTokenGranter.java b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/RefreshTokenGranter.java index dccc4653c..e84afa652 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/RefreshTokenGranter.java +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/refresh/RefreshTokenGranter.java @@ -22,8 +22,6 @@ import org.hswebframework.web.authorization.oauth2.server.AuthorizationService; import org.hswebframework.web.authorization.oauth2.server.OAuth2AccessToken; /** - * TODO 完成注释 - * * @author zhouhao */ public interface RefreshTokenGranter extends AuthorizationService { diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/src/main/java/org/hswebframework/web/oauth2/OAuth2GranterAutoConfiguration.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/src/main/java/org/hswebframework/web/oauth2/OAuth2GranterAutoConfiguration.java index 717e6e161..ab51fb9b7 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/src/main/java/org/hswebframework/web/oauth2/OAuth2GranterAutoConfiguration.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/src/main/java/org/hswebframework/web/oauth2/OAuth2GranterAutoConfiguration.java @@ -31,6 +31,8 @@ import org.hswebframework.web.authorization.oauth2.server.support.implicit.Impli import org.hswebframework.web.authorization.oauth2.server.support.password.DefaultPasswordGranter; import org.hswebframework.web.authorization.oauth2.server.support.password.PasswordGranter; import org.hswebframework.web.authorization.oauth2.server.support.password.PasswordService; +import org.hswebframework.web.authorization.oauth2.server.support.refresh.DefaultRefreshTokenGranter; +import org.hswebframework.web.authorization.oauth2.server.support.refresh.RefreshTokenGranter; import org.hswebframework.web.authorization.oauth2.server.token.AccessTokenService; import org.hswebframework.web.commons.entity.factory.EntityFactory; import org.hswebframework.web.dao.oauth2.AuthorizationCodeDao; @@ -42,14 +44,13 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; /** - * TODO 完成注释 - * * @author zhouhao */ @Configuration @@ -136,6 +137,12 @@ public class OAuth2GranterAutoConfiguration { return setProperty(new DefaultImplicitGranter()); } + @Bean + @ConditionalOnMissingBean(RefreshTokenGranter.class) + @ConfigurationProperties(prefix = "hsweb.oauth2.server") + public RefreshTokenGranter refreshTokenGranter() { + return setProperty(new DefaultRefreshTokenGranter()); + } } @Bean @@ -158,6 +165,9 @@ public class OAuth2GranterAutoConfiguration { if (bean instanceof ImplicitGranter) { addImplicitSupport(((ImplicitGranter) bean)); } + if (bean instanceof RefreshTokenGranter) { + addRefreshTokenSupport(((RefreshTokenGranter) bean)); + } return bean; }