I have a few sites that I am needing to find a way to make private pages where only people CAS authed can see them. I have been playing with Authorizer to handle the CAS authentication, and tying into the filter authorizer_allow_login or authorizer_custom_role, then using email_exists() to check to see if the CAS user has a wordpress account or not.

Now gets the tricky part, trying to figure out the best way to accomplish the private pages:

1) create a generic user in wp, and log in cas authed people into that account using wp_set_current_user(), and setting that user as subscriber, and allow subscriber roles to see private pages/posts.

2) set some cookie like for password protected pages.

3) somehow set the auth cookies without there being an actual account.

Anyone have any other suggestions, or any advice in how to set up one of the above methods?

The reason I don't want to create accounts for everyone is that there could be thousands of people logging in, and then they could leave the company, and we would have to find a way to audit and remove accounts for people who no longer exist.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.