-
Notifications
You must be signed in to change notification settings - Fork 157
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
authenticatable_salt if statement not processing. #151
Comments
What do you mean by a virtual attribute? Like an You may be able to just remove it though—without persistence, there's no point in using the property, because IdP-initiated logout won't work. |
Exactly, using a attr_accessor instead of storing it in the database. If it gets stored into the database and you open two browsers with two separate sessions, it overwrites the first session and you lose the ability to logout of that first session at the IdP level. Also, you understand my confusion of why I think it seems crazy that the puts or byebug make a difference. I can't explain it, but it seems to hold. We need to be able to store the session_index, because our IdP requires it for logout. So ultimately, I am really confused by this behavior also. Thanks for again joining me in our trip through this gem. |
Yeah, @BSorbus recently brought this up as well. I agree, this was naïve and should really have a separate table rather than one column on the users model. Are you solving this by storing it in the session? That could also work. It must be stored somewhere persistent besides the |
So. This seems to fix it although I need to look at it more closely to see why. Changing the send to read_attribute works.
|
I believe the attr_accessor puts it into the session. Right now we are over riding the method in our user model, but I think changing the send to a read_attribute fixes our problem. So for us to be able to log out of the IdP from our SP, we needed to make this change (over ride the authenticatable_salt method and add an attr_accessor for session_index on the user), write a custom idp_entity_id_reader (#117), and be on the fork associated with PR #149. I need to do some clean up, but I am hoping to submit some pull requests for these changes because I think they will benefit other people that are trying to sign out of an IdP. |
Hi,
…reconstruction a gem and work with many "session_index" |
That's really interesting, because |
I have some odd behavior when setting the saml_session_index_key. I am not sure if this is the best place to ask about this, please feel free to close if this is inappropriate.
We are currently using the fork for PR #149 because we need to have the SP initiated logout. I have some other issues which I need to put up my own PR for, but the specific issue here is that we are trying to store the session_index as a virtual attribute instead of in the database. I have been able to add it to our user model, but if fails to recognize the signed in user even though the session is created and the sign_in was successful.
We have traced this back to the authenticatable_salt method in devise_saml_authenticatable/lib/devise_saml_authenticatable/model.rb. Here is the crazy thing, if I add a puts statement with a copy of line 25 after it, it works.
puts "#{self.send(Devise.saml_session_index_key)}"
or if I add byebug after line 25 and simply continue through, it also works.
Any it would work in these instances but not normally.
As an aside, I also tried just adding a return to the line, but that did not allow it to process.
Thanks again for any help.
The text was updated successfully, but these errors were encountered: