Script for external authentication to Ejabberd server
- Import the library and implement one of interfaces:
Authorizator
- to provide custom authorizationUserChecker
- to provide custom user validationPasswordChanger
- to provide custom password changeUserRegister
- to provide custom user registrationUserRemover
orUserRemover3
- to provide custom user remove
- Pass your object to
NewExternal
dummy := Dummy{}
external := ejabberd.NewExternal(dummy)
external.Start()
dummy.go
- Accepts all authorizations with any user and password
- Compile examples/dummy.go
- Edit your ejabberd configuration file to:
auth_method: [external]
extauth_program: "/etc/ejabberd/compiledGoCode"
extauth_instances: 3
auth_use_cache: false
- Run your server and authorize under any user with any password
For more information see Ejabberd developers guide