summaryrefslogtreecommitdiff
path: root/eg/Auth-my_external_auth.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-07-02 21:11:29 -0700
committerIvan Kohler <ivan@freeside.biz>2013-07-02 21:11:29 -0700
commit3d0a1bb06b895c5be6e3f0517d355442a6b1e125 (patch)
tree84069ebc3254825b952a482e11cdbbbc69f6fe85 /eg/Auth-my_external_auth.pm
parentf3b99c11d6eed33f467dda360180a698a85c54e8 (diff)
parentd62206a94d9d49ef96640e0a8ec492679f8345e9 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'eg/Auth-my_external_auth.pm')
-rw-r--r--eg/Auth-my_external_auth.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/eg/Auth-my_external_auth.pm b/eg/Auth-my_external_auth.pm
new file mode 100644
index 000000000..8eda462f8
--- /dev/null
+++ b/eg/Auth-my_external_auth.pm
@@ -0,0 +1,28 @@
+package FS::Auth::my_external_auth;
+use base qw( FS::Auth::external ); #need to inherit from ::external
+
+use strict;
+
+sub authenticate {
+ my($self, $username, $check_password, $info ) = @_;
+
+ #your magic happens here
+
+ if ( $auth_good ) {
+
+ #optionally return a real name
+ #$info->{'first'} = "Jean";
+ #$info->{'last'} = "D'eau";
+
+ #optionally return a template username to copy access groups from that user
+ #$info->{'template_user'} = 'username';
+
+ return 1;
+
+ } else {
+ return 0;
+ }
+
+}
+
+1;