Taking things further
Rather than a global setting in config.php, can you think of a way of determining if the user has clicked on a link to a protected resource or the Log in link? If you can differentiate between clicking on the Log in link and a link to a course, for instance, then you could ensure that Moodle authenticates against WordPress only when a user attempts to access a protected resource (hint: look out for the $SESSION->wantsurl variable).
In the preceding example, we implemented three-legged authentication. Try investigating two-legged authentication. This would involve removing the need for the user to authorize access to the resource. Can you think of a way of implementing this? (Hint: this may require changes to the WordPress ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access