rubycas / rubycas-client

Ruby client for Yale's Central Authentication Service protocol -- an open source enterprise single sign on system for web applications.
http://code.google.com/p/rubycas-client/
Other
332 stars 217 forks source link

Enabled Multi Valued Attributes and Allow Data url redirection (307) (Optional in config) #95

Open akki-ng opened 7 years ago

akki-ng commented 7 years ago

Till now multivalued attributes were not received properly in RubyCasClient even though these were being sent as CAS Response. Typical use-case for this behaviour is "memberOf" attribute for LDAP/AD.

All data url(.json, .xml) were given 401 if unauthenticated, A new configuration :redirect_all can be given true in environment.rb to allow all urls(data url) to get self authenticated using basic auth.

To accomplish this we had to use 307 status code rather 302 to maintain initial request httpmethod and request body.

Http clients can use 307 to redirect requests properly, For example post call by Httparty will look like this

response = HTTParty.post( "My_URL_FOR_DATA_POST", :body => body.to_json, :headers => headers, :maintain_method_across_redirects => true, <———Must :resend_on_redirect => true <———Must )

akki-ng commented 7 years ago

Is there anything pending on my behalf?