Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get targetUrl #116

Open
Georgeqhh opened this issue Nov 6, 2018 · 5 comments
Open

Cannot get targetUrl #116

Georgeqhh opened this issue Nov 6, 2018 · 5 comments
Labels

Comments

@Georgeqhh
Copy link

Georgeqhh commented Nov 6, 2018

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

@Georgeqhh
Copy link
Author

Georgeqhh commented Nov 7, 2018

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?

@Georgeqhh
Copy link
Author

whether security+cas requires nginx's domain and service's domain are the same?

@kakawait
Copy link
Owner

kakawait commented Dec 5, 2018

@Georgeqhh what is your current application.{yml/properties} ? I would like to see your app configuration

@Georgeqhh
Copy link
Author

Georgeqhh commented Dec 8, 2018

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

@kakawait
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants