diff --git a/src/main/java/me/zhyd/oauth/config/AuthConfig.java b/src/main/java/me/zhyd/oauth/config/AuthConfig.java index e00e74227de6f5ddc6f9be91dc42957d0c6f3cea..38f4cccebc03df53439654602b4732dfe392c83a 100644 --- a/src/main/java/me/zhyd/oauth/config/AuthConfig.java +++ b/src/main/java/me/zhyd/oauth/config/AuthConfig.java @@ -155,7 +155,6 @@ public class AuthConfig { * @since 1.16.0 */ private String authServerId; - /** * 忽略校验 {@code redirectUri} 参数,默认不开启。当 {@code ignoreCheckRedirectUri} 为 {@code true} 时, * {@link me.zhyd.oauth.utils.AuthChecker#checkConfig(AuthConfig, AuthSource)} 将不会校验 {@code redirectUri} 的合法性。 @@ -164,16 +163,6 @@ public class AuthConfig { */ private boolean ignoreCheckRedirectUri; - /** - * 代理地址 - */ - private String proxyHost; - - /** - * 代理端口号 - */ - private Integer proxyPort; - /** * 适配 builder 模式 set 值的情况 * diff --git a/src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java b/src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java index 031bc96b2c38e2a0a0e01241cfe4eb741ce5c329..e4116456bc9eb7f720cb48861c960e631f8800f9 100644 --- a/src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java +++ b/src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java @@ -21,6 +21,8 @@ import me.zhyd.oauth.model.AuthUser; import me.zhyd.oauth.utils.StringUtils; import me.zhyd.oauth.utils.UrlBuilder; +import java.net.InetSocketAddress; + /** * 支付宝登录 * @@ -39,9 +41,11 @@ public class AuthAlipayRequest extends AuthDefaultRequest { public AuthAlipayRequest(AuthConfig config, AuthStateCache authStateCache) { super(config, AuthDefaultSource.ALIPAY, authStateCache); - if (StringUtils.isNotEmpty(config.getProxyHost()) && config.getProxyPort() != null) { + if (config.getHttpConfig() != null && config.getHttpConfig().getProxy() != null + && config.getHttpConfig().getProxy().address() instanceof InetSocketAddress) { + InetSocketAddress address = (InetSocketAddress) config.getHttpConfig().getProxy().address(); this.alipayClient = new DefaultAlipayClient(AuthDefaultSource.ALIPAY.accessToken(), config.getClientId(), config.getClientSecret(), - "json", "UTF-8", config.getAlipayPublicKey(), "RSA2", config.getProxyHost(), config.getProxyPort()); + "json", "UTF-8", config.getAlipayPublicKey(), "RSA2", address.getHostName(), address.getPort()); } else { this.alipayClient = new DefaultAlipayClient(AuthDefaultSource.ALIPAY.accessToken(), config.getClientId(), config.getClientSecret(), "json", "UTF-8", config.getAlipayPublicKey(), "RSA2");