-
Notifications
You must be signed in to change notification settings - Fork 269
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
Destination in server.rb logout now set and used correctly. #76
base: master
Are you sure you want to change the base?
Changes from all commits
d5ea7c0
8e50a1a
1a0b306
bc9c7b5
4e20749
901e937
37c14b6
de81060
a0cea4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,7 +310,7 @@ def self.init_database! | |
headers['Expires'] = (Time.now - 1.year).rfc2822 | ||
|
||
# optional params | ||
@service = clean_service_url(params['service']) | ||
@service = clean_service_url(params['service']) || settings.config[:default_service] | ||
@renew = params['renew'] | ||
@gateway = params['gateway'] == 'true' || params['gateway'] == '1' | ||
|
||
|
@@ -400,7 +400,7 @@ def self.init_database! | |
Utils::log_controller_action(self.class, params) | ||
|
||
# 2.2.1 (optional) | ||
@service = clean_service_url(params['service']) | ||
@service = clean_service_url(params['service']) || settings.config[:default_service] | ||
|
||
# 2.2.2 (required) | ||
@username = params['username'] | ||
|
@@ -516,7 +516,8 @@ def self.init_database! | |
# "logout" page, we take the user back to the login page with a "you have been logged out" | ||
# message, allowing for an opportunity to immediately log back in. This makes it | ||
# easier for the user to log out and log in as someone else. | ||
@service = clean_service_url(params['service'] || params['destination']) | ||
@service = clean_service_url(params['service']) | ||
@destination = params['destination'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to change that a little bit.
From which:
So I doubt that we need all of them. I think that we should use only service url which can be used as it is right now, plus possibility to do not redirect user after logout but just render login page with this service_url For example:
and we could add settings for it, like:
so everybody will have possibility to set default behavior and in case if it will be needed, we can force different behavior by passing param into url What do you think about that? |
||
@continue_url = params['url'] | ||
|
||
@gateway = params['gateway'] == 'true' || params['gateway'] == '1' | ||
|
@@ -559,10 +560,12 @@ def self.init_database! | |
|
||
@lt = generate_login_ticket | ||
|
||
if @gateway && @service | ||
if @gateway && @destination | ||
redirect @destination, 303 | ||
elsif @gateway && @service | ||
redirect @service, 303 | ||
elsif @continue_url | ||
render @template_engine, :logout | ||
render @template_engine, :login | ||
else | ||
render @template_engine, :login | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I investigate that a little bit more and I honestly I do not see any reason why someone would like to use it.
Could you provide some scenario for default_service option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just here because if someone goes straight to the rubycas server they just get a page saying they are logged in. I actually wanted them to go to something more useful like our main service. Also if they were already logged in and went straight to the rubycas server the same thing happens.
So if you had https://sso.example.com someone can go directly to that page and they get stuck.
Mos tof the time you want users to log in via a service such as https://service.example.com but they might not. This way you can default where they should go if they go straight to https://sso.example.com
I think as you point out below this was because continue_url was not coded correctly, and I can't remember what the specs say on that.
I've rolled my own solution since my initial playing around with rubycas-server so might be best to close this and submit a new cleaner patch. This patch was just a stepping stone that got it working for me how I needed it to work.