我们正在尝试做一个POC,我们将使用wso2身份服务器作为Oauth2身份验证服务器,并且我们使用ZUUL作为API网关Spring Boot Oauth2 SSO与wso2身份服务器使用zuul作为api-gateway与领事服务发现
zuul代理服务
@EnableZuulProxy
@EnableOAuth2Sso
@SpringBootApplication
public class ApiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(ApiGatewayApplication.class, args);
}
}
application.properties
security.basic.enabled=false
security.oauth2.client.accessTokenUri=https://172.16.0.102:9443/oauth2/token
security.oauth2.client.clientId=erX25bMjkEwIS7ZDxP5vYRM1r5Ya
security.oauth2.client.clientSecret=A2kDWZ_WVProSgf2TuNE15jy8Oga
security.oauth2.client.userAuthorizationUri=https://172.16.0.102:9443/oauth2/authorize
security.oauth2.client.preEstablishedRedirectUri=https://172.16.0.42:8900/resource/greeting
security.oauth2.client.useCurrentUri=false
security.oauth2.resource.userInfoUri=https://172.16.0.102:9443/oauth2/userinfo
security.oauth2.resource.preferTokenInfo=false
server.port=8900
spring.application.name=ZUUL
zuul.ignoreLocalService=false
server.ssl.key-store=wso2carbon.jks
server.ssl.key-store-password=wso2carbon
server.ssl.keyStoreType=jks
security.oauth2.client.grantType=authorization_code
zuul.routes.resource.path=/resource/**
zuul.routes.resource.url=https://localhost:8090
现在面临两个问题
我们是不是能够整合领事,ZUUL服务,我的服务能够与领事注册,但是当我添加@EnableZuulProxy我的服务无法连接到领事它 抛出一个异常
com.ecwid.consul.transport.TransportException: java.net.ConnectException:连接被拒绝:连接
我们现在可以重定向到wso2 IS的登录页面,当我们尝试登录时,它会尝试将我重定向回到回拨URL ,但我的浏览器无法获得访问令牌,并且它说太多重定向。我无法理解,是因为我的配置还是其他原因。 我试图清除我的历史表明,当我GOOGLE了它,但它不工作
如果任何人有任何想法,这个请大家帮忙.....
感谢您的回复,它确实有助于理解问题,但问题的实际原因是自签名证书,我会更新答案 –