diff --git a/config/proxyauth.config.php b/config/proxyauth.config.php index 47e9b9f..f4bc452 100644 --- a/config/proxyauth.config.php +++ b/config/proxyauth.config.php @@ -1,15 +1,36 @@ array( + // (bool) To replace the login form with a single button 'replace_form' => false, + + // (string) Text for single signon button 'button_text' => 'Login with SSO', + + // (bool) To set remember me 'remember' => true, + + // (string) Domain of SSO portal + // May be needed to prevent redirect loop on logout 'sso_domain' => '', + + // (string) URL to redirect to after logout + // will use an internal redirect to /logout_ssoif not set 'logout_url' => '', + + // (bool) To automatically create a new account 'create_account' => true, + + // (string) Index of $_SERVER containing the username - REQUIRED 'username_header' => 'REMOTE_USER', + + // (string) Index of $_SERVER containing the user's email address 'email_header' => '', + + // (string) Index of $_SERVER containing the user's fullname 'fullname_header' => '' ) ); diff --git a/proxyauth.php b/proxyauth.php index 8cb8d86..24ebea4 100644 --- a/proxyauth.php +++ b/proxyauth.php @@ -113,7 +113,9 @@ function proxyauth_auth(){ } function proxyauth_create_user( $uid, $mail, $name ){ - $pass = hash( 'sha512', random_( 256 ) ); + // Generate random password + $pass = hash( 'sha512', random_bytes( 256 ) ); + User::create( array( 'username' => $name, 'nickname' => $uid,