How do I write a new auth plugin ?

How do I write a new auth plugin ?

ដោយ George Pipkin នៅ
ចំនួនតប៖ 3
Hi -

I need to write an auth plugin to meet some special authentication needs we
have at U.Va., and I have gone over the stuff in /auth, in particular the CAS
plugin. I have a dim outline of how the thing works, but I need some specific
answer to the following questions:

1) Is there anyplace where there is a cookbook-style description of how to write an auth plugin ?

2) Absent #1, I'm assuming you set up a new directory and you need to write
a file called auth.php that extends auth_plugin_base that is found in authlib.php - that file is a pretty good description of what's needed. What I haven't figured out is how you get your plugin to appear on the list of plugins that is in the Administration->Users-Authentication page so I can turn it on.

- George Pipkin
U.Va.
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ George Pipkin

Re: How do I write a new auth plugin ?

ដោយ Guido Vega នៅ
Hi George,

As regard to point #2, Moodle is clever enough to pick it up all by itself.

You do need to modify the lang file (lang/en_utf8/auth.php) and add you entry to the $string array – don’t worry this file is pretty self-explanatory and soon as you open it up you will know what to do.

Regards,

GV
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ George Pipkin

Re: How do I write a new auth plugin ?

ដោយ Martín Langhoff នៅ
Don't use CAS as your guide ញាក់ចិញ្ចើម it's quite exceptionally complex and messy, in part in that it depends on LDAP. Much saner to model your plugin on a saner template.
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ George Pipkin

Re: How do I write a new auth plugin ?

ដោយ Tim Hunt នៅ
រូបភាព Core developers រូបភាព Documentation writers រូបភាព Particularly helpful Moodlers រូបភាព Peer reviewers រូបភាព Plugin developers
Re: 1), it looks like someone started here: http://docs.moodle.org/en/Authentication_API, but this also looks out-of-date. So better to trust the code. If possibly, as you learn to write an auth pluing your self, could you update and extend that wiki page. I am sure if you start writing it, experts will review and correct it.
មធ្យមភាគនៃរង្វាយតម្លៃ: -