cas-security-spring-boot-starter
cas-security-spring-boot-starter copied to clipboard
Cannot get targetUrl
nginx :
listen 9001;
location / {
proxy_pass http://192.168.208.1:8762/main;
}
when I access localhost:9001, after login, SavedRequestAwareAuthenticationSuccessHandler
cannot get the targetUrl so that redirect to http://192.168.208.1:8762, but what I want is http://192.168.208.1:8762/main
I acess localhost:9001 and then nginx will pass to http://192.168.208.1:8762/main(url1), url1 is required to login,so the application will redirect to http://localhost:8080/cas/login?service=http://192.168.208.1:8762/login. After logining cas,it redirect to http://192.168.208.1:8762/login, but it doesn't carry the the session that I get in accessing localhost:9001 ,so that cannot get the request that save in session that it redirect to http://192.168.208.1:8762. How to carry the session that I get in accessing localhost:9001 when it redirect to http://192.168.208.1:8762/login?
whether security+cas requires nginx's domain and service's domain are the same?
@Georgeqhh what is your current application.{yml/properties}
? I would like to see your app configuration
security:
cas:
server:
base-url: http://.../cas
paths:
login: ${security.cas.server.base-url}/login
service:
base-url: http://192.168.208.1:8762
paths:
login: /login
@Georgeqhh
regarding
when I access localhost:9001, after login, SavedRequestAwareAuthenticationSuccessHandler cannot get the targetUrl so that redirect to http://192.168.208.1:8762, but what I want is http://192.168.208.1:8762/main
Why are you not tweaking your RP to
listen 9001;
location /main {
proxy_pass http://192.168.208.1:8762/main;
}
Because /main
is part of your external URL