]> BookStack Code Mirror - website/commitdiff
Added v0.28 blog images, finished saml2 auth
authorDan Brown <redacted>
Sun, 2 Feb 2020 22:02:20 +0000 (22:02 +0000)
committerDan Brown <redacted>
Sun, 2 Feb 2020 22:02:20 +0000 (22:02 +0000)
15 files changed:
content/blog/beta-release-v0-28-0.md
content/docs/admin/saml2-auth.md [new file with mode: 0644]
static/images/2020/02/api-docs.png [new file with mode: 0644]
static/images/2020/02/api-token-generation.png [new file with mode: 0644]
static/images/2020/02/api-user-tokens.png [new file with mode: 0644]
static/images/2020/02/bookstack-saml.png [new file with mode: 0644]
static/images/2020/02/bookstack-test-email.png [new file with mode: 0644]
static/images/2020/02/crowdin-overview.png [new file with mode: 0644]
static/images/2020/02/test-emails.png [new file with mode: 0644]
static/images/2020/02/text-overrides.png [new file with mode: 0644]
static/images/2020/02/theme-colors.png [new file with mode: 0644]
themes/bookstack/layouts/partials/footer.html
themes/bookstack/layouts/partials/header.html
themes/bookstack/layouts/partials/menu_admin_docs.html
themes/bookstack/static/js/script.js

index 811ca0fb731adf6c766e70697579c04bda4bcdfe..91a13bbf9dd082d4f043e97347b48855fef35c9f 100644 (file)
@@ -21,27 +21,48 @@ Our first 2020 release arrives with some great new features such as an initial A
 
 The foundations for the API have been laid within this release. This includes a limited set of endpoints that covers basic "book" CRUD operations.
 
+![API User Tokens](/images/2020/02/api-user-tokens.png)
+
+![API Token Generation](/images/2020/02/api-token-generation.png)
+
+![API Docs](/images/2020/02/api-docs.png)
+
+
 // TODO
 
 ### SAML2 Authentication
 
+![BookStack SAML2 Authentication](/images/2020/02/bookstack-saml.png)
+
 // TODO
 
 ### Theme Color Customization
 
+![BookStack theme color customization](/images/2020/02/theme-colors.png)
+
 // TODO
 
 ### Test Email Sending
 
+![BookStack Test Email Sending](/images/2020/02/test-emails.png)
+
+![BookStack Test Email Example](/images/2020/02/bookstack-test-email.png)
+
+
+
+
 // TODO
 
 ### Override Translation Text
 
 // TODO
 
+![BookStack Translation Text Overrides](/images/2020/02/text-overrides.png)
+
+
 ### Under-the-Hood Changes
 
-// TODO - Laravel, Refactor
+// TODO - Laravel, Refactor, Auth
 
 ### Translations
 
@@ -51,6 +72,8 @@ The foundations for the API have been laid within this release. This includes a
 
 // Crowdin
 
+![BookStack Translation Text Overrides](/images/2020/02/crowdin-overview.png)
+
 #### Translation Updates
 
 // TODO
diff --git a/content/docs/admin/saml2-auth.md b/content/docs/admin/saml2-auth.md
new file mode 100644 (file)
index 0000000..834f282
--- /dev/null
@@ -0,0 +1,121 @@
++++
+title = "SAML 2.0 Authentication"
+description = "How to use SAML2 as an authentication option in BookStack"
+date = "2020-01-25"
+type = "admin-doc"
++++
+
+BookStack can be configured to utilise a SAML 2.0 based authentication provider as a solution for users to log-in, log-out and self-register within BookStack. This replaces the default email & password authentication mechanism within BookStack. When enabled, BookStack will attempt to match the SAML user to an existing BookStack user based on a stored external id attribute otherwise, if not found, BookStack will effectively auto-register that user to provide a seamless access experience.
+
+### BookStack Configuration
+
+To set up SAML 2.0 based authentication add or modify the following variables in your `.env` file:
+
+```bash
+# Set authentication method to be saml2
+AUTH_METHOD=saml2
+
+# Set the display name to be shown on the login button.
+# (Login with <name>)
+SAML2_NAME=SSO
+
+# Name of the attribute which provides the user's email address
+SAML2_EMAIL_ATTRIBUTE=email
+
+# Name of the attribute to use as an ID for the SAML user.
+SAML2_EXTERNAL_ID_ATTRIBUTE=uid
+
+# Name of the attribute(s) to use for the user's display name
+# Can have mulitple attributes listed, separated with a '|' in which 
+# case those values will be joined with a space.
+# Example: SAML2_DISPLAY_NAME_ATTRIBUTES=firstName|lastName
+# Defaults to the ID value if not found.
+SAML2_DISPLAY_NAME_ATTRIBUTES=username
+
+# Identity Provider entityID URL
+SAML2_IDP_ENTITYID=https://example.com/saml2/idp/metadata.php
+
+# Auto-load metatadata from the IDP
+# Setting this to true negates the need to specify the next three options
+SAML2_AUTOLOAD_METADATA=false
+
+# Identity Provider single-sign-on service URL
+# Not required if using the autoload option above.
+SAML2_IDP_SSO=https://example.com/saml2/idp/SSOService.php
+
+# Identity Provider single-logout-service URL
+# Not required if using the autoload option above.
+# Not required if your identity provider does not support SLS.
+SAML2_IDP_SLO=https://example.com/saml2/idp/SingleLogoutService.php
+
+# Identity Provider x509 public certificate data.
+# Not required if using the autoload option above.
+SAML2_IDP_x509=<cert_data>
+```
+
+A user in BookStack will be linked to a SAML user via the `SAML2_EXTERNAL_ID_ATTRIBUTE`. If the value of this id changes in the identity provider it can be updated in BookStack by an admin by changing the 'External Authentication ID' field on the user's profile.
+
+### Identity Provider Configuration
+
+You'll likely need to provide some details of your BookStack service-provider to your identity provider. Below are the URL paths you'll likely need. Only the relative paths are shown below so you'll need to append them to your BookStack base URL.
+
+* `/saml2/metadata` - Metadata endpoint *(GET)*
+* `/saml2/asc` - Assertion Consumer Service endpoint *(POST)*
+* `/saml2/sls` - Single Logout Service endpoint *(GET)*
+
+BookStack uses the following formats/bindings for communication with the IdP:
+
+* NameIDFormat: `urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`
+* ACS/SLO Binding: `urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST`
+
+Here's a minimal example of configuring a BookStack service provider for a SimpleSAMLphp IdP:
+
+```php
+$metadata['http://bookstack.local/saml2/metadata'] = [
+    'AssertionConsumerService' => 'http://bookstack.local/saml2/acs',
+    'SingleLogoutService' => 'http://bookstack.local/saml2/sls',
+    'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
+];
+```
+
+### Debugging
+
+To help when setting up or configuring BookStack to use your SAML system, there are a few additional `.env` options that can help provide more insight:
+
+```bash
+# Enable the BookStack general debug mode, Provides more error insight.
+# Note, Can leak sensitive details so only use in private, secure environments.
+APP_DEBUG=true
+
+# Option to dump out SAML 2.0 user details as JSON.
+# Only for debugging purposes since it will prevent login.
+SAML2_DUMP_USER_DETAILS=false
+
+# Option to override settings passed to the underlying onelogin library
+# used by BookStack. For development, debugging and testing only.
+# Options provided will be recursively merged into other default & dynamic options.
+# Defaults found within app/Config/saml2.php, under the 'onelogin' key.
+SAML2_ONELOGIN_OVERRIDES=<json_format_data>
+```
+
+### SAML Group Sync
+
+BookStack has the ability to sync SAML user groups with BookStack roles. By default this will match SAML group names with the BookStack role display names with casing ignored.
+This can be overridden by via the 'External Authentication IDs' field which can be seen when editing a role while SAML authentication is enabled. If filled, the names in this field will be used and the role display name will be ignored. You can match on multiple names by separating them with a comma.
+
+When matching SAML groups with role names or 'External Authentication IDs' values, BookStack will standardise the names of SAML groups to be lower-cased and spaces will be replaced with hyphens. For example, to match a SAML group named "United Kingdom" an 'External Authentication IDs' value of "united-kingdom" could be used.
+
+This feature requires the SAML server to be able to provide user groups when queried. You'll need to specify the attribute using the `SAML2_GROUP_ATTRIBUTE` option as shown below. Keep in mind you can use the `SAML2_DUMP_USER_DETAILS` option, as shown in the above [debugging](#debugging) section to dump out the attribute values that BookStack fetches from your IdP.
+
+Here are the settings required to be added to your `.env` file to enable group syncing:
+
+```bash
+# Enable SAML group sync.
+SAML2_USER_TO_GROUPS=true
+
+# Set the attribute from which BookStack will read groups names from.
+SAML2_GROUP_ATTRIBUTE=groups
+
+# Removed user from roles that don't match SAML groups upon login.
+SAML2_REMOVE_FROM_GROUPS=true
+```
diff --git a/static/images/2020/02/api-docs.png b/static/images/2020/02/api-docs.png
new file mode 100644 (file)
index 0000000..bc34a97
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a24c2ebc9d489402c89f66db9bb3702badc9586480039db356f7742848467da3
+size 27524
diff --git a/static/images/2020/02/api-token-generation.png b/static/images/2020/02/api-token-generation.png
new file mode 100644 (file)
index 0000000..4cd28b4
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d65d57178eb125e7d5836b025788c11cae95ac5e608e25466e3976779b99c832
+size 24954
diff --git a/static/images/2020/02/api-user-tokens.png b/static/images/2020/02/api-user-tokens.png
new file mode 100644 (file)
index 0000000..871fd36
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7d50d8896c07afbdd3bcfba90196d08555f496d2d3a30eeb9f9dfe5d1d6a1c22
+size 10347
diff --git a/static/images/2020/02/bookstack-saml.png b/static/images/2020/02/bookstack-saml.png
new file mode 100644 (file)
index 0000000..d37c075
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:99065329db16ff88aa40f7ef5741e0a38c37a8abb2feaa84f6c34bad0312d906
+size 6620
diff --git a/static/images/2020/02/bookstack-test-email.png b/static/images/2020/02/bookstack-test-email.png
new file mode 100644 (file)
index 0000000..d0f1bc4
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eb9dc548f94c0fea99efc44b5bf648298121e83bd297409a2157532a684e4a90
+size 8841
diff --git a/static/images/2020/02/crowdin-overview.png b/static/images/2020/02/crowdin-overview.png
new file mode 100644 (file)
index 0000000..76b1ca9
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d00e83f2a66ed9d5c11c061f5bb5fc27723e37612fb4283a7906bb93c3bf0613
+size 21440
diff --git a/static/images/2020/02/test-emails.png b/static/images/2020/02/test-emails.png
new file mode 100644 (file)
index 0000000..2e8eb85
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:168091d79c10371bfe4ddcb0ba392d40e2f8b0a1459a9d6df3a3c1d59b0de4dc
+size 5094
diff --git a/static/images/2020/02/text-overrides.png b/static/images/2020/02/text-overrides.png
new file mode 100644 (file)
index 0000000..a3b0c62
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6b7f4d0e829a764b4097ba1016b510cd2898835595b6069c7d8453feaf86b3b7
+size 2897
diff --git a/static/images/2020/02/theme-colors.png b/static/images/2020/02/theme-colors.png
new file mode 100644 (file)
index 0000000..b78fd16
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ef937462abaeb812975f567c05bd737f7cd05c3b334f22e827bc05b324b0a5f5
+size 14480
index d454eed901bc46af2e89b2557f496a8035f1ef9f..e6b67995edf4c6b750672307d43a7717170e9515 100644 (file)
@@ -25,7 +25,7 @@
         </div>
     </footer>
 
-
+    <script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
     <script type="text/javascript">
     if (document.querySelector('.doc-search-input') !== null) {
         docsearch({
index 1ec48038a27c350716e41941ba7d57ea54068795..60727e46a13ef4055ce120aba94449baff05861c 100644 (file)
 
     <!-- at the end of the HEAD -->
     <link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
-    <!-- at the end of the BODY -->
-    <script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
 
     {{ if .Site.Params.customHeaderPartial }}
         {{ partial .Site.Params.customHeaderPartial . }}
index e58eadafc84fe1625e621217a6c258947e440909..1b269efd1192c66377653dece86fc4dc9cdbe709 100644 (file)
        <li><a href="/docs/admin/debugging">Debugging</a></li>
 </ul>
 
+<h4>Authentication</h4>
+<ul>
+       <li><a href="/docs/admin/saml2-auth">SAML 2.0</a></li>
+       <li><a href="/docs/admin/ldap-auth">LDAP</a></li>
+       <li><a href="/docs/admin/social-auth">Third Party & Social</a></li>
+</ul>
+
 <h4>Configuration</h4>
 <ul>
        <li><a href="/docs/admin/visual-customisation">Visual Customisation</a></li>
        <li><a href="/docs/admin/language-config">Language &amp; Locale</a></li>
        <li><a href="/docs/admin/upload-config">File Uploads</a></li>
        <li><a href="/docs/admin/cache-session-config">Caching &amp; Sessions</a></li>
-       <li><a href="/docs/admin/social-auth">Third Party Authentication</a></li>
-       <li><a href="/docs/admin/ldap-auth">LDAP Authentication</a></li>
+
        <li><a href="/docs/admin/pdf-rendering">PDF Rendering</a></li>
        <li><a href="/docs/admin/ut8mb4-support">UTF8mb4/Emoji Support</a></li>
        <li><a href="/docs/admin/other-config">Other Configuration</a></li>
index a6783ea105b09be04f08b25b4c4c8844b73716bb..19364df02164e40c29b69fde5a80d3a6fe006e82 100644 (file)
@@ -41,7 +41,8 @@ var modeMap = {
   'language-js': 'javascript',
   'language-shell': 'bash',
   'language-nginx': 'nginx',
-  'language-apache': 'apache'
+  'language-apache': 'apache',
+  'language-php': 'php',
 };
 
 var codeBlocks = document.querySelectorAll('pre');