NOW MANAGED ON CODEBERG
Added icon for saml, added saml to register page, updated complete env
Dan Brown6d899f3b1759
diff --git a/.env.example.complete b/.env.example.completeindex c4c3f0b85..e8c212f39 100644--- a/.env.example.complete+++ b/.env.example.complete@@ -201,6 +201,28 @@ LDAP_USER_TO_GROUPS=falseLDAP_GROUP_ATTRIBUTE="memberOf"LDAP_REMOVE_FROM_GROUPS=false+# SAML authentication configuration+# Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/+SAML2_NAME=SSO+SAML2_ENABLED=false+SAML2_AUTO_REGISTER=true+SAML2_EMAIL_ATTRIBUTE=email+SAML2_DISPLAY_NAME_ATTRIBUTES=username+SAML2_EXTERNAL_ID_ATTRIBUTE=null+SAML2_IDP_ENTITYID=null+SAML2_IDP_SSO=null+SAML2_IDP_SLO=null+SAML2_IDP_x509=null+SAML2_ONELOGIN_OVERRIDES=null+SAML2_DUMP_USER_DETAILS=false+SAML2_AUTOLOAD_METADATA=false++# SAML group sync configuration+# Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/+SAML2_USER_TO_GROUPS=false+SAML2_GROUP_ATTRIBUTE=group+SAML2_REMOVE_FROM_GROUPS=false+# Disable default third-party services such as Gravatar and Draw.IO# Service-specific options will override this optionDISABLE_EXTERNAL_SERVICES=falsediff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.phpindex 304d3bed2..000833029 100644--- a/app/Http/Controllers/Auth/RegisterController.php+++ b/app/Http/Controllers/Auth/RegisterController.php@@ -103,7 +103,11 @@ class RegisterController extends Controller{$this->checkRegistrationAllowed();$socialDrivers = $this->socialAuthService->getActiveDrivers();- return view('auth.register', ['socialDrivers' => $socialDrivers]);+ $samlEnabled = (config('saml2.enabled') === true) && (config('saml2.auto_register') === true);+ return view('auth.register', [+ 'socialDrivers' => $socialDrivers,+ 'samlEnabled' => $samlEnabled,+ ]);}/**diff --git a/resources/icons/saml2.svg b/resources/icons/saml2.svgnew file mode 100644index 000000000..a9a2994a7--- /dev/null+++ b/resources/icons/saml2.svg@@ -0,0 +1,4 @@+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <path d="M0 0h24v24H0z" fill="none"/>+ <path d="M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/>+</svg>\ No newline at end of filediff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.phpindex 4ac7a50e0..836150d69 100644--- a/resources/views/auth/login.blade.php+++ b/resources/views/auth/login.blade.php@@ -49,7 +49,7 @@<hr class="my-l"><div><a id="saml-login" class="button outline block svg" href="{{ url("/saml2/login") }}">- {{-- @icon('auth/github') --}}+ @icon('saml2'){{ trans('auth.log_in_with', ['socialDriver' => config('saml2.name')]) }}</a></div>diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.phpindex 0e996a00d..8dd6592c1 100644--- a/resources/views/auth/register.blade.php+++ b/resources/views/auth/register.blade.php@@ -49,6 +49,16 @@</div>@endforeach@endif++ @if($samlEnabled)+ <hr class="my-l">+ <div>+ <a id="saml-login" class="button outline block svg" href="{{ url("/saml2/login") }}">+ @icon('saml2')+ {{ trans('auth.log_in_with', ['socialDriver' => config('saml2.name')]) }}+ </a>+ </div>+ @endif</div></div>@stop