diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-05-09 21:42:37 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-05-09 21:42:37 -0700 |
commit | 56f9dffcd409d2a10e7a2cbe4c15b397f6f3abe1 (patch) | |
tree | 1b151c7f2348965c10823644201fc33a070dfa7b /eg/Auth-my_external_auth.pm | |
parent | 19eef2ec0e68587304cd597fc5b2f8e1f151e424 (diff) |
NG auth: autocreate records for external users, RT#21563
Diffstat (limited to 'eg/Auth-my_external_auth.pm')
-rw-r--r-- | eg/Auth-my_external_auth.pm | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/eg/Auth-my_external_auth.pm b/eg/Auth-my_external_auth.pm index 38f9d5bfb..8eda462f8 100644 --- a/eg/Auth-my_external_auth.pm +++ b/eg/Auth-my_external_auth.pm @@ -4,24 +4,25 @@ use base qw( FS::Auth::external ); #need to inherit from ::external use strict; sub authenticate { - my($self, $username, $check_password ) = @_; + my($self, $username, $check_password, $info ) = @_; - #magic happens here + #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'; - if ( $auth_good ) { #verbose for clarity return 1; + } else { return 0; } } -#omitting these subroutines will eliminate those options from the UI - -#sub create_user { -# - -#sub change_password { -#} - 1; |