]> BookStack Code Mirror - bookstack/commitdiff
Added icon for saml, added saml to register page, updated complete env
authorDan Brown <redacted>
Sun, 17 Nov 2019 16:07:06 +0000 (16:07 +0000)
committerDan Brown <redacted>
Sun, 17 Nov 2019 16:07:06 +0000 (16:07 +0000)
.env.example.complete
app/Http/Controllers/Auth/RegisterController.php
resources/icons/saml2.svg [new file with mode: 0644]
resources/views/auth/login.blade.php
resources/views/auth/register.blade.php

index c4c3f0b85ff1192839395d1cc7edb3b965802b8f..e8c212f3931dd358c0142c587831742b35d2bf31 100644 (file)
@@ -201,6 +201,28 @@ LDAP_USER_TO_GROUPS=false
 LDAP_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 option
 DISABLE_EXTERNAL_SERVICES=false
index 304d3bed2e69999b381e0a8e1b4cb6a22790f492..000833029a48cfe663dc43384b357496bf9f0f50 100644 (file)
@@ -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.svg
new file mode 100644 (file)
index 0000000..a9a2994
--- /dev/null
@@ -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 file
index 4ac7a50e0979c4d2b074914d1acfbe540e263331..836150d69bdb6db3fa54a2129280a27365b59252 100644 (file)
@@ -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>
index 0e996a00d2300e1d27ecba57976260af441e6ee0..8dd6592c1e72084f4acba1059a56f226c80102d7 100644 (file)
                     </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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.