leo108 / php_cas_server

PHP CAS Server
MIT License
219 stars 47 forks source link

Getting attributes #14

Closed MiragePresent closed 6 years ago

MiragePresent commented 6 years ago

Hello! I'm trying to configure cas auth for my projects and I stoped on your app. I like it very much, very cool and simple for configure. Please, tell me how can I get all the user attributes (such as email, name etc.) from cas server?

leo108 commented 6 years ago

Hi, assume that you are using phpCAS as your CAS client, make sure you are using v3 as your protocol because attributes was introduced since v3

phpCAS::client(CAS_VERSION_3_0, $cas_host, $cas_port, $cas_context);
var_dump(phpCAS::getAttributes());
MiragePresent commented 6 years ago

Thanks. It works