Spring Oauth2 Authentication AWS behind Zuul

我的梦境 提交于 2019-12-11 01:29:57

问题


I have a problem/question. I have a "typical" spring cloud netflix environment at aws running.

Now to my problem:

Given (working authentication): Request (https: //DOMAIN.net/) -> AWS Load balancer (adds headers X-Forwarded-For and X-Forwarded-Proto) -> Zuul

The route / for zuul is secured this means spring security correctly redirects the user to https: //DOMAIN/login and this triggers the correct redirect to our auth server with the correct redirect URI. No problem here.

Given (not working authentication): Request (https: //DOMAIN.net/service) -> AWS Load balancer (adds headers X-Forwarded-For and X-Forwarded-Proto) -> Zuul (adds headers X-Forwarded-Prefix) -> Service

The route / at our service is secured and the application redirects to https://localhost/service/login. I would expect a redirect to https:// DOMAIN/service/login.

I don't get it why this fails. The requests are correct IMO. Also all required headers are proxied to the service..

My problem is: No oauth2 authentication possible behind zuul.

I hope anyone can help me here. I'm trying already for ages but no results :/.

(Please check https://github.com/spring-cloud/spring-cloud-netflix/issues/942 for more details. I did already a lot of research and tried nearly everything..)

Edit: For simplicity we are running our service on the same machine as our zuul. This means our zuul route configuration does route /service/** to http: //localhost:10001/service and the prefix is not stripped. The routing works perfect. Just the authentication.. The routes to /service/** are not secured at zuul.

来源:https://stackoverflow.com/questions/36361181/spring-oauth2-authentication-aws-behind-zuul

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!