0

This is the data that I get back from the rubycas server.

{
  "cn"=>"--- - Toby Joiner", 
  "sn"=>"--- - Joiner", 
  "mail"=>"--- - tobyjoiner@xxxxxx.xxx", 
  "memberof"=>"--- 
      - CN=All Users,OU=AllUsers,DC=bnw,DC=local
      - CN=Administrators,CN=Builtin,DC=bnw,DC=local 
      - CN=Remote Desktop Users,CN=Builtin,DC=bnw,DC=local", 
  "givenname"=>"--- - Toby"
}

I am wondering if there is a way I am supposed pull this data out, right now I am doing:

first_name = session[:cas_extra_attributes][:sn].gsub('-','')

to remove the dashes. I am hoping I am just missing the built in way to get the extra data out from the rubycas server.

Toby Joiner
  • 4,306
  • 7
  • 32
  • 47

1 Answers1

1

That looks like YAML escaped data. You should be able to get rid of it by first parsing it through YAML.load and then processing it as you wish.


As a small aside, I've personally re-implemented the basic functions of rubycas-server as a Rails engine called cassy. However, I don't think it supports sending through extra attributes at the moment.

I just thought I'd mention it as it gives you an alternative to try if rubycas-server doesn't work out.

Moshe Katz
  • 15,992
  • 7
  • 69
  • 116
Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
  • Thank you. The issue now is the rubycas-client overflowing the cookie buffer, which I fixed by changing the sessions to activerecord, but then it mangles the yaml. Oh well, your answer is the right one for what I asked. – Toby Joiner Jun 27 '11 at 14:50