dashy/docs/authentication/index.html
2026-03-13 09:27:14 +00:00

333 lines
No EOL
114 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-authentication" data-has-hydrated="false">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.9.2">
<title data-rh="true">Authentication | Dashy</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="keywords" content="dashy, dashboard, homelab, self-hosted, docker, homepage"><meta data-rh="true" property="og:type" content="website"><meta data-rh="true" property="og:url" content="https://dashy.to"><meta data-rh="true" property="og:image" content="https://dashy.to/img/dashy.png"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" name="twitter:title" content="Dashy — The Ultimate Homepage for your Homelab"><meta data-rh="true" name="twitter:description" content="Dashy is a self-hosted dashboard app for your homelab. Manage all your services, with status checks, widgets, themes and more."><meta data-rh="true" name="twitter:image" content="https://dashy.to/img/dashy.png"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Authentication | Dashy"><meta data-rh="true" name="description" content="- Basic Auth"><meta data-rh="true" property="og:description" content="- Basic Auth"><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://dashy.to/docs/authentication"><link data-rh="true" rel="alternate" href="https://dashy.to/docs/authentication" hreflang="en"><link data-rh="true" rel="alternate" href="https://dashy.to/docs/authentication" hreflang="x-default"><script data-rh="true" type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Authentication","item":"https://dashy.to/docs/authentication"}]}</script><link rel="preconnect" href="https://pixelflare.cc">
<link rel="preconnect" href="https://cdn.as93.net">
<link rel="dns-prefetch" href="https://api.github.com">
<link rel="dns-prefetch" href="https://no-track.as93.net">
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebSite","name":"Dashy","url":"https://dashy.to","description":"The Ultimate Homepage for your Homelab","publisher":{"@type":"Person","name":"Alicia Sykes","url":"https://aliciasykes.com"}}</script>
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#54bff7">
<script src="https://no-track.as93.net/js/script.js" defer="defer" data-domain="dashy.to"></script><link rel="stylesheet" href="/assets/css/styles.643115f2.css">
<script src="/assets/js/runtime~main.e7aa91cf.js" defer="defer"></script>
<script src="/assets/js/main.c9f7c5e0.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
<svg style="display: none;"><defs>
<symbol id="theme-svg-external-link" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol>
</defs></svg>
<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||"dark"),document.documentElement.setAttribute("data-theme-choice",t||"dark")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div class="banner_woPo"><a class="link_ecgS" title="View the changelog, to see what&#x27;s new!" href="/updates">Dashy <!-- -->V3.1.9<!-- --> is now live 🚀</a><a class="link2_y3x6" title="View the changelog, to see what&#x27;s new!" href="/updates">See what&#x27;s new…</a><button class="closeBtn_fC0A" title="Dismiss update, and don&#x27;t show again" aria-label="Dismiss update, and don&#x27;t show again">×</button></div><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="theme-layout-navbar navbar navbar--fixed-top"><div class="navbar__inner"><div class="theme-layout-navbar-left navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/dashy.png" alt="Dashy Logo" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/dashy.png" alt="Dashy Logo" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div><b class="navbar__title text--truncate">Dashy</b></a><a href="https://github.com/lissy93/dashy" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_nPIU"><use href="#theme-svg-external-link"></use></svg></a><a href="https://demo.dashy.to" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Live Demo<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_nPIU"><use href="#theme-svg-external-link"></use></svg></a><a class="navbar__item navbar__link" href="/docs/quick-start">Quick Start</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs">Documentation</a></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP systemToggleIcon_QzmC"><path fill="currentColor" d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"></path></svg></button></div><div class="navbarSearchContainer_Bca1"><div class="navbar__search searchBarContainer_NW3z" dir="ltr"><input placeholder="Search" aria-label="Search" class="navbar__search-input searchInput_YFbd" value=""><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="theme-layout-main main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/quick-start"><span title="Running Dashy" class="categoryLinkLabel_W154">Running Dashy</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" href="/docs/icons"><span title="Feature Docs" class="categoryLinkLabel_W154">Feature Docs</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/icons"><span title="Icons" class="linkLabel_WmDU">Icons</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/widgets"><span title="Widgets" class="linkLabel_WmDU">Widgets</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/theming"><span title="Theming" class="linkLabel_WmDU">Theming</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/status-indicators"><span title="Status Indicators" class="linkLabel_WmDU">Status Indicators</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/authentication"><span title="Authentication" class="linkLabel_WmDU">Authentication</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/searching"><span title="Keyboard Shortcuts" class="linkLabel_WmDU">Keyboard Shortcuts</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/alternate-views"><span title="Alternate Views &amp; Opening Methods" class="linkLabel_WmDU">Alternate Views &amp; Opening Methods</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/multi-language-support"><span title="Internationalization" class="linkLabel_WmDU">Internationalization</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/backup-restore"><span title="Cloud Backup and Restore" class="linkLabel_WmDU">Cloud Backup and Restore</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/pages-and-sections"><span title="Pages and Sections" class="linkLabel_WmDU">Pages and Sections</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/showcase"><span title="Community" class="categoryLinkLabel_W154">Community</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/privacy"><span title="Misc" class="categoryLinkLabel_W154">Misc</span></a></div></li></ul></nav></div><div class="sidebar-ad"><script async="" src="//cdn.carbonads.com/carbon.js?serve=CWYIC53L&amp;placement=dashyto" id="_carbonads_js"></script></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Feature Docs</span></li><li class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link">Authentication</span></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Authentication</h1></header>
<ul>
<li class=""><a href="#built-in-auth" class="">Basic Auth</a>
<ul>
<li class=""><a href="#setting-up-authentication" class="">Setting Up Authentication</a></li>
<li class=""><a href="#hash-password" class="">Hash Password</a></li>
<li class=""><a href="#logging-in-and-out" class="">Logging In and Out</a></li>
<li class=""><a href="#enabling-guest-access" class="">Guest Access</a></li>
<li class=""><a href="#granular-access" class="">Per-User Access</a></li>
<li class=""><a href="#using-environment-variables-for-passwords" class="">Using Environment Variables for Passwords</a></li>
<li class=""><a href="#adding-http-auth-to-configuration" class="">Adding HTTP Auth to Configuration</a></li>
<li class=""><a href="#security" class="">Security Considerations</a></li>
</ul>
</li>
<li class=""><a href="#http-auth" class="">HTTP Auth</a></li>
<li class=""><a href="#keycloak" class="">Keycloak Auth</a>
<ul>
<li class=""><a href="#1-deploy-keycloak" class="">Deploying Keycloak</a></li>
<li class=""><a href="#2-setup-keycloak-users" class="">Setting up Keycloak</a></li>
<li class=""><a href="#3-enable-keycloak-in-dashy-config-file" class="">Configuring Dashy for Keycloak</a></li>
<li class=""><a href="#troubleshooting-keycloak" class="">Toubleshooting Keycloak</a></li>
</ul>
</li>
<li class=""><a href="#oidc" class="">OIDC Auth</a>
<ul>
<li class=""><a href="#authentik" class="">authentik</a></li>
</ul>
</li>
<li class=""><a href="#alternative-authentication-methods" class="">Alternative Authentication Methods</a>
<ul>
<li class=""><a href="#vpn" class="">VPN</a></li>
<li class=""><a href="#ip-based-access" class="">IP-Based Access</a></li>
<li class=""><a href="#web-server-authentication" class="">Web Server Authentication</a></li>
<li class=""><a href="#oauth-services" class="">OAuth Services</a></li>
<li class=""><a href="#static-site-hosting-providers" class="">Auth on Cloud Hosting Services</a></li>
</ul>
</li>
</ul>
<blockquote>
<p>[!IMPORTANT]
Dashy&#x27;s built-in auth is not indented to protect a publicly hosted instance against unauthorized access. Instead you should use an auth provider compatible with your reverse proxy, or access Dashy via your VPN, or implement your own SSO logic.</p>
<p>In cases where Dashy is only accessibly within your home network, and you just want to add a login page, then the built-in auth may be sufficient, but keep in mind that configuration can still be accessed.</p>
</blockquote>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="built-in-auth">Built-In Auth<a href="#built-in-auth" class="hash-link" aria-label="Direct link to Built-In Auth" title="Direct link to Built-In Auth" translate="no"></a></h2>
<p>Dashy has a basic login page included, and frontend authentication. You can enable this by adding users to the <code>auth</code> section under <code>appConfig</code> in your <code>conf.yml</code>. If this section is not specified, then no authentication will be required to access the app, and the homepage will resolve to your dashboard.</p>
<blockquote>
<p>[!NOTE]
Since the auth is initiated in the main app entry point (for security), a rebuild is required to apply changes to the auth configuration.
You can trigger a rebuild through the UI, under Config --&gt; Rebuild, or by running <code>yarn build</code> in the root directory.</p>
</blockquote>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="setting-up-authentication">Setting Up Authentication<a href="#setting-up-authentication" class="hash-link" aria-label="Direct link to Setting Up Authentication" title="Direct link to Setting Up Authentication" translate="no"></a></h3>
<p>The <code>auth</code> property takes an array of users. Each user needs to include a username, hash and optional user type (<code>admin</code> or <code>normal</code>). The hash property is a <a href="https://en.wikipedia.org/wiki/SHA-2" target="_blank" rel="noopener noreferrer" class="">SHA-256 Hash</a> of your desired password.</p>
<p>For example:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">appConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">auth</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">users</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> alicia</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hash</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> 4D1E58C90B3B94BCAD9848ECCACD6D2A8C9FBC5CA913304BBA5CDEAB36FEEFA3</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">type</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> bob</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hash</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> 5E884898DA28047151D0E56F8DC6292773603D0D6AABBDD62A11EF721D1542D8</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="hash-password">Hash Password<a href="#hash-password" class="hash-link" aria-label="Direct link to Hash Password" title="Direct link to Hash Password" translate="no"></a></h3>
<p>Dashy uses <a href="https://en.wikipedia.org/wiki/Sha-256" target="_blank" rel="noopener noreferrer" class="">SHA-256 Hash</a>, a 64-character string, which you can generate using an online tool, such as <a href="https://passwordsgenerator.net/sha256-hash-generator/" target="_blank" rel="noopener noreferrer" class="">this one</a> or <a href="https://gchq.github.io/CyberChef/" target="_blank" rel="noopener noreferrer" class="">CyberChef</a> (which can be self-hosted/ ran locally).</p>
<p>A hash is a one-way cryptographic function, meaning that it is easy to generate a hash for a given password, but very hard to determine the original password for a given hash. This means, that so long as your password is long, strong and unique, it is safe to store its hash in the clear. Having said that, you should never reuse passwords, hashes can be cracked by iterating over known password lists, generating a hash of each.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="logging-in-and-out">Logging In and Out<a href="#logging-in-and-out" class="hash-link" aria-label="Direct link to Logging In and Out" title="Direct link to Logging In and Out" translate="no"></a></h3>
<p>Once authentication is enabled, so long as there is no valid token in cookie storage, the application will redirect the user to the login page. When the user enters credentials in the login page, they will be checked, and if valid, then a token will be generated, and they can be redirected to the home page. If credentials are invalid, then an error message will be shown, and they will remain on the login page. Once in the application, to log out: the user can click the logout button (in the top-right), which will clear cookie storage, causing them to be redirected back to the login page.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="enabling-guest-access">Enabling Guest Access<a href="#enabling-guest-access" class="hash-link" aria-label="Direct link to Enabling Guest Access" title="Direct link to Enabling Guest Access" translate="no"></a></h3>
<p>With authentication set up, by default no access is allowed to your dashboard without first logging in with valid credentials. Guest mode can be enabled to allow for read-only access to a secured dashboard by any user, without the need to log in. A guest user cannot write any changes to the config file, but can apply modifications locally (stored in their browser). You can enable guest access, by setting <code>appConfig.auth.enableGuestAccess: true</code>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="granular-access">Granular Access<a href="#granular-access" class="hash-link" aria-label="Direct link to Granular Access" title="Direct link to Granular Access" translate="no"></a></h3>
<p>You can use the following properties to make certain pages, sections or items only visible to some users, or hide pages, sections and items from guests.</p>
<ul>
<li class=""><code>hideForUsers</code> - Page, Section or Item will be visible to all users, except for those specified in this list</li>
<li class=""><code>showForUsers</code> - Page, Section or Item will be hidden from all users, except for those specified in this list</li>
<li class=""><code>hideForGuests</code> - Page, Section or Item will be visible for logged in users, but not for guests</li>
</ul>
<p>For Example:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">pages</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> Home Lab</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">path</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> home</span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain">lab.yml</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">displayData</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">showForUsers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">admin</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> Intranet</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">path</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> intranet.yml</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">displayData</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hideForGuests</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hideForUsers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">alicia</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> bob</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre></div></div>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> Code Analysis &amp; Monitoring</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">icon</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> fas fa</span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain">code</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">displayData</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">cols</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token number">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hideForUsers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">alicia</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> bob</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">items</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">...</span><br></span></code></pre></div></div>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> Deployment Pipelines</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">icon</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> fas fa</span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain">rocket</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">displayData</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hideForGuests</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">items</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">title</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> Hide Me</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">displayData</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hideForUsers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">alicia</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> bob</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="permissions">Permissions<a href="#permissions" class="hash-link" aria-label="Direct link to Permissions" title="Direct link to Permissions" translate="no"></a></h3>
<p>Any user who is not an admin (with <code>type: admin</code>) will not be able to write changes to disk.</p>
<p>You can also prevent any user from writing changes to disk, using <code>preventWriteToDisk</code>. Or prevent any changes from being saved locally in browser storage, using <code>preventLocalSave</code>. Both properties can be found under <a class="" href="/docs/configuring#appconfig-optional"><code>appConfig</code></a>.</p>
<p>To disable all UI config features, including View Config, set <code>disableConfiguration</code>. Alternatively you can disable UI config features for all non admin users by setting <code>disableConfigurationForNonAdmin</code> to true.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="using-environment-variables-for-passwords">Using Environment Variables for Passwords<a href="#using-environment-variables-for-passwords" class="hash-link" aria-label="Direct link to Using Environment Variables for Passwords" title="Direct link to Using Environment Variables for Passwords" translate="no"></a></h3>
<p>If you don&#x27;t want to hash your password, you can instead leave out the <code>hash</code> attribute, and replace it with <code>password</code> which should have the value of an environmental variable name you wish to use.</p>
<p>Note that env var must begin with <code>VUE_APP_</code>, and you must set this variable before building the app.</p>
<p>For example:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">auth</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">users</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> bob</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">password</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> VUE_APP_BOB</span><br></span></code></pre></div></div>
<p>Just be sure to set <code>VUE_APP_BOB=&#x27;my super secret password&#x27;</code> before build-time.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="adding-http-auth-to-configuration">Adding HTTP Auth to Configuration<a href="#adding-http-auth-to-configuration" class="hash-link" aria-label="Direct link to Adding HTTP Auth to Configuration" title="Direct link to Adding HTTP Auth to Configuration" translate="no"></a></h3>
<p>If you&#x27;d also like to prevent direct visit access to your configuration file, you can set the <code>ENABLE_HTTP_AUTH</code> environmental variable.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="security">Security<a href="#security" class="hash-link" aria-label="Direct link to Security" title="Direct link to Security" translate="no"></a></h3>
<p>With basic auth, all logic is happening on the client-side, which could mean a skilled user could manipulate the code to view parts of your configuration, including the hash. If the SHA-256 hash is of a common password, it may be possible to determine it, using a lookup table, in order to find the original password. Which can be used to manually generate the auth token, that can then be inserted into session storage, to become a valid logged in user. Therefore, you should always use a long, strong and unique password, and if you instance contains security-critical info and/ or is exposed directly to the internet, and alternative authentication method may be better. The purpose of the login page is merely to prevent immediate unauthorized access to your homepage.</p>
<p><strong><strong><a href="#" class="">⬆️ Back to Top</a></strong></strong></p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="http-auth">HTTP Auth<a href="#http-auth" class="hash-link" aria-label="Direct link to HTTP Auth" title="Direct link to HTTP Auth" translate="no"></a></h2>
<p>If you&#x27;d like to protect all your config files from direct access, you can set the <code>BASIC_AUTH_USERNAME</code> and <code>BASIC_AUTH_PASSWORD</code> environmental variables. You&#x27;ll then be prompted to enter these credentials when visiting Dashy.</p>
<p>Then, if you&#x27;d like your frontend to automatically log you in, without prompting you for credentials (insecure, so only use on a trusted environment), then also specify <code>VUE_APP_BASIC_AUTH_USERNAME</code> and <code>VUE_APP_BASIC_AUTH_PASSWORD</code>. This is useful for when you&#x27;re hosting Dashy on a private server, and just want to use auth for user management and to prevent direct access to your config files, while still allowing the frontend to access them. Note that a rebuild is required for these changes to take effect.</p>
<p><strong><strong><a href="#" class="">⬆️ Back to Top</a></strong></strong></p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="keycloak">Keycloak<a href="#keycloak" class="hash-link" aria-label="Direct link to Keycloak" title="Direct link to Keycloak" translate="no"></a></h2>
<p>Dashy also supports using a <a href="https://www.keycloak.org/" target="_blank" rel="noopener noreferrer" class="">Keycloak</a> authentication server. The setup for this is a bit more involved, but it gives you greater security overall, useful for if your instance is exposed to the internet.</p>
<p><a href="https://www.keycloak.org/about.html" target="_blank" rel="noopener noreferrer" class="">Keycloak</a> is a Java-based <a href="https://github.com/keycloak/keycloak" target="_blank" rel="noopener noreferrer" class="">open source</a>, high-performance, secure authentication system, supported by <a href="https://www.redhat.com/en" target="_blank" rel="noopener noreferrer" class="">RedHat</a>. It is easy to setup (<a href="https://quay.io/repository/keycloak/keycloak" target="_blank" rel="noopener noreferrer" class="">with Docker</a>), and enables you to secure multiple self-hosted applications with single-sign-on using standard protocols (OpenID Connect, OAuth 2.0, SAML 2.0 and social login). It&#x27;s also very customizable, you can write or use custom <a href="https://wjw465150.gitbooks.io/keycloak-documentation/content/server_development/topics/themes.html" target="_blank" rel="noopener noreferrer" class="">themes</a>, <a href="https://www.keycloak.org/extensions.html" target="_blank" rel="noopener noreferrer" class="">plugins</a>, <a href="https://wjw465150.gitbooks.io/keycloak-documentation/content/server_admin/topics/authentication/password-policies.html" target="_blank" rel="noopener noreferrer" class="">password policies</a> and more.
The following guide will walk you through setting up Keycloak with Dashy. If you already have a Keycloak instance configured, then skip to Step 3.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-deploy-keycloak">1. Deploy Keycloak<a href="#1-deploy-keycloak" class="hash-link" aria-label="Direct link to 1. Deploy Keycloak" title="Direct link to 1. Deploy Keycloak" translate="no"></a></h3>
<p>First thing to do is to spin up a new instance of Keycloak. You will need <a href="https://docs.docker.com/engine/install/" target="_blank" rel="noopener noreferrer" class="">Docker installed</a>, and can then choose a tag, and pull the container from <a href="https://quay.io/repository/keycloak/keycloak" target="_blank" rel="noopener noreferrer" class="">quay.io/keycloak/keycloak</a></p>
<p>Use the following run command, replacing the attributes (default credentials, port and name), or incorporate this into your docker-compose file.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker run -d \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -p 8081:8080 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --name auth-server \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -e KEYCLOAK_USER=admin \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -e KEYCLOAK_PASSWORD=admin \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> quay.io/keycloak/keycloak:15.0.2</span><br></span></code></pre></div></div>
<p>If you need to pull from DockerHub, a non-official image is available <a href="https://registry.hub.docker.com/r/jboss/keycloak" target="_blank" rel="noopener noreferrer" class="">here</a>. Or if you would prefer not to use Docker, you can also directly install Keycloak from source, following <a href="https://www.keycloak.org/docs/latest/getting_started/index.html" target="_blank" rel="noopener noreferrer" class="">this guide</a>.</p>
<p>You should now be able to access the Keycloak web interface, using the port specified above (e.g. <code>http://127.0.0.1:8081</code>), login with the default credentials, and when prompted create a new password.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-setup-keycloak-users">2. Setup Keycloak Users<a href="#2-setup-keycloak-users" class="hash-link" aria-label="Direct link to 2. Setup Keycloak Users" title="Direct link to 2. Setup Keycloak Users" translate="no"></a></h3>
<p>Before we can use Keycloak, we must first set it up with some users. Keycloak uses Realms (similar to tenants) to create isolated groups of users. You must create a Realm before you will be able to add your first user.</p>
<ol>
<li class="">Head over to the admin console</li>
<li class="">In the top-left corner there is a dropdown called &#x27;Master&#x27;, hover over it and then click &#x27;Add Realm&#x27;</li>
<li class="">Give your realm a name, and hit &#x27;Create&#x27;</li>
</ol>
<p>You can now create your first user.</p>
<ol>
<li class="">In the left-hand menu, click &#x27;Users&#x27;, then &#x27;Add User&#x27;</li>
<li class="">Fill in the form, including username and hit &#x27;Save&#x27;</li>
<li class="">Under the &#x27;Credentials&#x27; tab, give the new user an initial password. They will be prompted to change this after first login</li>
</ol>
<p>The last thing we need to do in the Keycloak admin console is to create a new client</p>
<ol>
<li class="">Within your new realm, navigate to &#x27;Clients&#x27; on the left-hand side, then click &#x27;Create&#x27; in the top-right</li>
<li class="">Choose a &#x27;Client ID&#x27;, set &#x27;Client Protocol&#x27; to &#x27;openid-connect&#x27;, and for &#x27;Valid Redirect URIs&#x27; put a URL pattern to where you&#x27;re hosting Dashy (if you&#x27;re just testing locally, then * is fine), and do the same for the &#x27;Web Origins&#x27; field</li>
<li class="">Make note of your client-id, and click &#x27;Save&#x27;</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-enable-keycloak-in-dashy-config-file">3. Enable Keycloak in Dashy Config File<a href="#3-enable-keycloak-in-dashy-config-file" class="hash-link" aria-label="Direct link to 3. Enable Keycloak in Dashy Config File" title="Direct link to 3. Enable Keycloak in Dashy Config File" translate="no"></a></h3>
<p>Now that your Keycloak instance is up and running, all that&#x27;s left to do is to configure Dashy to use it. Under <code>appConfig</code>, set <code>auth.enableKeycloak: true</code>, then fill in the details in <code>auth.keycloak</code>, including: <code>serverUrl</code> - the URL where your Keycloak instance is hosted, <code>realm</code> - the name you gave your Realm, and <code>clientId</code> - the Client ID you chose.
For example:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">appConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">auth</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">enableKeycloak</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">keycloak</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">serverUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;http://localhost:8081&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">realm</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;alicia-homelab&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">clientId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;dashy&#x27;</span><br></span></code></pre></div></div>
<p>Note that if you are using Keycloak V 17 or older, you will also need to set <code>legacySupport: true</code> (also under <code>appConfig.auth.keycloak</code>). This is because the API endpoint was updated in later versions.</p>
<p>If you use Keycloak with an external Identity Provier, you can set the <code>idpHint: &#x27;alias-of-kc-idp&#x27;</code> option to allow the IdP Hint to be passed to Keycloak. This will cause Keycloak to skip its login page and redirect the user directly to the specified IdP&#x27;s login page. Set to the value of the &#x27;Alias&#x27; field of the desired IdP as defined in Keycloak under &#x27;Identity Providers&#x27;.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-add-groups-and-roles-optional">4. Add groups and roles (Optional)<a href="#4-add-groups-and-roles-optional" class="hash-link" aria-label="Direct link to 4. Add groups and roles (Optional)" title="Direct link to 4. Add groups and roles (Optional)" translate="no"></a></h3>
<p>Keycloak allows you to assign users roles and groups. You can use these values to configure who can access various sections or items in Dashy.
Keycloak server administration and configuration is a deep topic; please refer to the <a href="https://www.keycloak.org/docs/latest/server_admin/index.html#assigning-permissions-and-access-using-roles-and-groups" target="_blank" rel="noopener noreferrer" class="">server admin guide</a> to see details about creating and assigning roles and groups.
Once you have groups or roles assigned to users you can configure access under each section or item <code>displayData.showForKeycloakUser</code> and <code>displayData.hideForKeycloakUser</code>.
Both show and hide configurations accept a list of <code>groups</code> and <code>roles</code> that limit access. If a users data matches one or more items in these lists they will be allowed or excluded as defined.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">sections</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> DeveloperResources</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">displayData</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">showForKeycloakUsers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">roles</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;canViewDevResources&#x27;</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hideForKeycloakUsers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">groups</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;ProductTeam&#x27;</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">items</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">title</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> Not Visible for developers</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">displayData</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">hideForKeycloakUsers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">groups</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;DevelopmentTeam&#x27;</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre></div></div>
<p>Depending on how you&#x27;re hosting Dashy and Keycloak, you may also need to set some HTTP headers, to prevent a CORS error. This would typically be the <code>Access-Control-Allow-Origin [URL-of Dashy]</code> on your Keycloak instance. See the <a class="" href="/docs/management#setting-headers">Setting Headers</a> guide in the management docs for more info.</p>
<p>Your app is now secured :) When you load Dashy, it will redirect to your Keycloak login page, and any user without valid credentials will be prevented from accessing your dashboard.</p>
<p>From within the Keycloak console, you can then configure things like time-outs, password policies, etc. You can also backup your full Keycloak config, and it is recommended to do this, along with your Dashy config. You can spin up both Dashy and Keycloak simultaneously and restore both applications configs using a <code>docker-compose.yml</code> file, and this is recommended.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="troubleshooting-keycloak">Troubleshooting Keycloak<a href="#troubleshooting-keycloak" class="hash-link" aria-label="Direct link to Troubleshooting Keycloak" title="Direct link to Troubleshooting Keycloak" translate="no"></a></h3>
<p>If you encounter issues with your Keycloak setup, follow these steps to troubleshoot and resolve common problems.</p>
<ol>
<li class="">
<p>Client Authentication Issue
Problem: Redirect loop, if client authentication is enabled.
Solution: Switch off &quot;client authentication&quot; in &quot;TC clients&quot; -&gt; &quot;Advanced&quot; settings.</p>
</li>
<li class="">
<p>Double URL
Problem: If you get redirected to &quot;<a href="https://dashy.my.domain/#iss=https://keycloak.my.domain/realms/my-realm" target="_blank" rel="noopener noreferrer" class="">https://dashy.my.domain/#iss=https://keycloak.my.domain/realms/my-realm</a>&quot;
Solution: Make sure to turn on &quot;Exclude Issuer From Authentication Response&quot; in &quot;TC clients&quot; -&gt; &quot;Advanced&quot; -&gt; &quot;OpenID Connect Compatibility Modes&quot;</p>
</li>
<li class="">
<p>Problems with mutiple Dashy Pages
Problem: Refreshing or logging out of dashy results in an &quot;invalid_redirect_uri&quot; error.
Solution: In &quot;TC clients&quot; -&gt; &quot;Access settings&quot; -&gt; &quot;Root URL&quot; <a href="https://dashy.my.domain/" target="_blank" rel="noopener noreferrer" class="">https://dashy.my.domain/</a>, valid redirect URIs must be /*</p>
</li>
</ol>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="oidc">OIDC<a href="#oidc" class="hash-link" aria-label="Direct link to OIDC" title="Direct link to OIDC" translate="no"></a></h2>
<p>Dashy also supports using a general <a href="https://openid.net/connect/" target="_blank" rel="noopener noreferrer" class="">OIDC compatible</a> authentication server. In order to use it, the authentication section needs to be configured:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">appConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">auth</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">enableOidc</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">oidc</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">clientId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">registered client id</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">endpoint</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">OIDC endpoint</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">scope</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">The scope(s) to request from the OIDC provider</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">adminGroup</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> admin</span><br></span></code></pre></div></div>
<p>Because Dashy is a SPA, a <a href="https://datatracker.ietf.org/doc/html/rfc6749#section-2.1" target="_blank" rel="noopener noreferrer" class="">public client</a> registration with PKCE is needed.</p>
<p>An example for Authelia is shared below, but other OIDC systems can be used:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">identity_providers</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">oidc</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">clients</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token key atrule">client_id</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> dashy</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">client_name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> dashy</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">public</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">authorization_policy</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;one_factor&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">require_pkce</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">pkce_challenge_method</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;S256&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">redirect_uris</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> https</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">//dashy.local </span><span class="token comment" style="color:rgb(98, 114, 164)"># should point to your dashy endpoint</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">grant_types</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> authorization_code</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">scopes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;openid&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;profile&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;roles&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;email&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;groups&#x27;</span><br></span></code></pre></div></div>
<p>Groups and roles will be populated and available for controlling display similar to <a href="#Keycloak" class="">Keycloak</a> above.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="authentik">authentik<a href="#authentik" class="hash-link" aria-label="Direct link to authentik" title="Direct link to authentik" translate="no"></a></h3>
<p>This documentation is specific to <code>authentik</code>, however it may be useful in getting other idP&#x27;s working with <code>Dashy</code>.</p>
<p>This guide will only walk through the following:</p>
<ul>
<li class="">Creating and configuring an OIDC provider</li>
<li class="">Creating and configuring an application</li>
<li class="">Assigning groups</li>
<li class="">Configuring <code>Dashy</code> to use the OIDC client</li>
<li class="">Show quick examples of how to hide/show <code>pages</code>, <code>items</code>, and <code>sections</code> using OIDC groups</li>
</ul>
<p>This guide assumes the following:</p>
<ul>
<li class="">You have a working instance of <code>authentik</code> terminated with SSL</li>
<li class="">You have a working instance of <code>Dashy</code> terminated with SSL</li>
<li class="">Users and groups are provisioned</li>
<li class="">You are familiar with how <code>authentik</code> works in case you need to do further troubleshooting that is outside the scope of this guide.</li>
</ul>
<blockquote>
<p>[!TIP]
It it recommended that you create groups specific for <code>Dashy</code>. Groups will allow you to display content based on group membership as well as limiting user access to <code>Dashy</code>. If you do not need this functionality, then you can forgo creating specific groups.</p>
</blockquote>
<blockquote>
<p>[!TIP]
You can use the application wizard to create the provider and application at one time. This is the recommended route, but only the manual process will be outlined in this guide.</p>
</blockquote>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/72e45162-6c86-4d6f-a1ae-724ac503c00c" alt="image" class="img_ev3q"></p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-create-an-oidc-provider">1. Create an OIDC provider<a href="#1-create-an-oidc-provider" class="hash-link" aria-label="Direct link to 1. Create an OIDC provider" title="Direct link to 1. Create an OIDC provider" translate="no"></a></h4>
<p>Login to the admin console for <code>authentik</code>. Go to <code>Applications</code> &gt; <code>Providers</code>. Click <code>Create</code>.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/c1f7f45d-469c-4bf1-a825-34658341a83e" alt="image" class="img_ev3q"></p>
<p>A dialog box will pop-up, select the <code>OAuth2/OpenID Provider</code>. Click <code>Next</code>.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/ea84fe57-b813-404d-8dad-5e221b440bdb" alt="image" class="img_ev3q"></p>
<p>On the next page of the wizard, set the <code>Name</code>, <code>Authentication flow</code>, and <code>Authorization flow</code>. See example below. Using the <code>default-provider-authorization-implicit-consent</code> authorization flow on internal services and <code>default-provider-authorization-explicit-consent</code> on external services is a common practice. However, it is fully up to you on how you would like to configure this option. <code>Implicit</code> will login directly without user consent, <code>explicit</code> will ask if the user approves the service being logged into with their user credentials.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/e600aeaf-08d1-49aa-b304-11e90e5c89cd" alt="image" class="img_ev3q"></p>
<p>Scroll down and configure the <code>Protocol settings</code>. Set the <code>Client type</code> to <code>Public</code>. Add the <code>Redirect URIs/Origins (RegEx)</code>. If the site is hosted at <code>dashy.lan.domain.com</code>, then you would enter as the example below.</p>
<blockquote>
<p>[!NOTE]
If you have an internal and external domain for <code>Dashy</code>, enter both URI&#x27;s. Enter each URI on a new line.</p>
</blockquote>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/4a289d7e-d7b4-4ff6-af5d-3e5202fae84e" alt="image" class="img_ev3q"></p>
<p>Scroll down to set the <code>Signing Key</code>. It is recommended to use the built in <code>authentik Self-signed Certificate</code> here unless you have special needs for your own custom cert.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/386c0750-9d2b-4482-8938-8b301b489b38" alt="image" class="img_ev3q"></p>
<p>Expand <code>Advanced protocol settings</code> then verify the <code>Scopes</code> are set to what is highlighted in <code>white</code> below. Set the <code>Subject mode</code> to <code>Based on the Users&#x27;s Email</code>.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/ae5e87b8-1ad6-41dd-b6e1-9665623f842a" alt="image" class="img_ev3q"></p>
<p>Lastly, toggle <code>Include claims in id_token</code> to on. Click <code>Finish</code> to complete creating the provider.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/25353b3c-3f54-47cf-bd47-b5023f86d7cf" alt="image" class="img_ev3q"></p>
<p>Grab the generated <code>Client ID</code> and <code>OpenID Configuration Issuer</code> URL by clicking the newly created provider as this will use this later when <code>Dashy</code> is configured to use the OIDC auth mechanism. In this tutorial, what was generated is used below. Obviously adjust the <code>Client ID</code> that was generated and use your domain here for the <code>issuer</code>.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Client ID: pzN9DCMLqHTTatgtYFg50cl0jn1NmCyBC3wreX15</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">OpenID Configuration Issuer: https://auth.domain.com/application/o/dashy/</span><br></span></code></pre></div></div>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-create-an-application">2. Create an application<a href="#2-create-an-application" class="hash-link" aria-label="Direct link to 2. Create an application" title="Direct link to 2. Create an application" translate="no"></a></h4>
<p>Make sure you are still in the <code>authentik</code> admin console then go to <code>Applications</code> &gt; <code>Applications</code>. Click <code>Create</code>.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/fd225936-15a1-409f-83c8-e24a43047df0" alt="image" class="img_ev3q"></p>
<p>Next, it is required to give a user facing <code>Name</code>, <code>Slug</code> and assign the newly created provider. Use the example below if you have been following the guide. If you have used your own naming, then adjust accordingly. Click <code>Create</code> once you are done.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/e6574d7d-6b22-4e7d-b388-45341b98746b" alt="image" class="img_ev3q"></p>
<blockquote>
<p>[!TIP]
Open the application in a new tab from the <code>authentik</code> user portal and upload a custom icon. You can also enter a user facing <code>Description</code> that the user would see.</p>
</blockquote>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/20561387-549f-49de-98e6-30330dcdc734" alt="image" class="img_ev3q"></p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-optional-limiting-access-via-authentik-with-groups">3. <em>(Optional)</em> Limiting access via <code>authentik</code> with groups<a href="#3-optional-limiting-access-via-authentik-with-groups" class="hash-link" aria-label="Direct link to 3-optional-limiting-access-via-authentik-with-groups" title="Direct link to 3-optional-limiting-access-via-authentik-with-groups" translate="no"></a></h4>
<p>If you would like to deny <code>Dashy</code> access from specific users who are not within <code>authentik</code> based groups, you bind them to the application you just created now. <code>authentik</code> will deny access to those who are not members of this group or groups. If you want to allow everyone access from your <code>authentik</code> instance, skip this step.</p>
<p>Make sure you are still in the <code>authentik</code> admin console then go to <code>Applications</code> &gt; <code>Applications</code>. Click the newly created <code>Dashy</code> application.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/613fafe7-881f-4664-a903-945854ac65e2" alt="image" class="img_ev3q"></p>
<p>Click the <code>Policy/Group/User Bindings</code> tab at the top, then click <code>Bind existing policy</code>. This assumes you have already created the groups you want to use for <code>Dashy</code> and populated users in those groups.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/10fca15b-e77d-4624-ae03-0ece3910904c" alt="image" class="img_ev3q"></p>
<p>Click <code>Group</code> for the binding type. Under <code>Group</code> select the appropriate group you would like to bind. Make sure <code>Enabled</code> is toggeled on. Click <code>Create</code>.</p>
<p><img decoding="async" loading="lazy" src="https://github.com/user-attachments/assets/ebf680ab-696f-4c08-ae89-d73fe92b398f" alt="image" class="img_ev3q"></p>
<p><code>Dashy</code> will now be scoped only to users within the assigned groups you have bound the application to. Keep adding groups if you would like to adjust the dashboard visibilty based on group membership.</p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-configure-dashy-to-use-oidc-client">4. Configure <code>Dashy</code> to use OIDC client<a href="#4-configure-dashy-to-use-oidc-client" class="hash-link" aria-label="Direct link to 4-configure-dashy-to-use-oidc-client" title="Direct link to 4-configure-dashy-to-use-oidc-client" translate="no"></a></h4>
<blockquote>
<p>[!IMPORTANT]
It is highly recommended to edit your <code>conf.yml</code> directly for this step.</p>
</blockquote>
<blockquote>
<p>[!CAUTION]
Do not make the same mistake many have made here by including the fully qualified address for the <code>OpenID Configuration URL</code>. <code>Dashy</code> will append the <code>.well-known</code> configuration automatically. If the <code>.well-known</code> URI is included the app will get redirect loops and <code>400</code> errors.</p>
</blockquote>
<p>Enter the <code>Client ID</code> in the <code>clientId</code> field and <code>OpenID Configuration Issuer</code> in the <code>endpoint</code> field.</p>
<p>Below is how to configure the <code>auth</code> section in the yaml syntax. Once this is enabled, when an attempt to access <code>Dashy</code> is made it will now redirect you to the <code>authentik</code> login page moving forward.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">appConfig:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> theme: glass</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> layout: auto</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> iconSize: medium</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> auth:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> enableOidc: true</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> oidc:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> clientId: pzN9DCMLqHTTatgtYFg50cl0jn1NmCyBC3wreX15</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> endpoint: https://auth.domain.com/application/o/dashy/</span><br></span></code></pre></div></div>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="5-optional-example-snippets-for-dashboard-visibility">5. <em>(OPTIONAL)</em> Example snippets for dashboard visibility<a href="#5-optional-example-snippets-for-dashboard-visibility" class="hash-link" aria-label="Direct link to 5-optional-example-snippets-for-dashboard-visibility" title="Direct link to 5-optional-example-snippets-for-dashboard-visibility" translate="no"></a></h4>
<p>Using the <code>hideForKeycloakUsers</code> configuration option is needed to use the <code>authentik</code> groups that were created previously.</p>
<p>Adjusting <code>pages</code> visibility:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">pages:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - name: App Management</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> path: appmgmt.yml</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> displayData:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> hideForKeycloakUsers:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> groups:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - Dashy Users</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - name: Network Management</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> path: network.yml</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> displayData:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> hideForKeycloakUsers:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> groups:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - Dashy Users</span><br></span></code></pre></div></div>
<p>Adjusting <code>items</code> visibility:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> items:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - title: Authentik Admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> icon: authentik.svg</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> url: https://auth.domain.com/if/admin/</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> target: newtab</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> id: 0_1472_authentikadmin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> displayData:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> hideForKeycloakUsers:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> groups:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - Dashy Users</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - title: Authentik User</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> icon: authentik-light.png</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> url: https://auth.domain.com/if/user/</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> target: newtab</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> id: 1_1472_authentikuser</span><br></span></code></pre></div></div>
<p>Adjusting <code>sections</code> visibility:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">sections:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - name: Authentication</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> displayData:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> sortBy: default</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> rows: 2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> cols: 1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> collapsed: false</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> hideForGuests: false</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> hideForKeycloakUsers:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> groups: </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - Dashy Users</span><br></span></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="alternative-authentication-methods">Alternative Authentication Methods<a href="#alternative-authentication-methods" class="hash-link" aria-label="Direct link to Alternative Authentication Methods" title="Direct link to Alternative Authentication Methods" translate="no"></a></h2>
<p>If you are self-hosting Dashy, and require secure authentication to prevent unauthorized access, then you can either use Keycloak, or one of the following options:</p>
<ul>
<li class=""><a href="#authentication-server" class="">Authentication Server</a> - Put Dashy behind a self-hosted auth server</li>
<li class=""><a href="#vpn" class="">VPN</a> - Use a VPN to tunnel into the network where Dashy is running</li>
<li class=""><a href="#ip-based-access" class="">IP-Based Access</a> - Disallow access from all IP addresses, except your own</li>
<li class=""><a href="#web-server-authentication" class="">Web Server Authentication</a> - Enable user control within your web server or proxy</li>
<li class=""><a href="#oauth-services" class="">OAuth Services</a> - Implement a user management system using a cloud provider</li>
<li class=""><a href="#static-site-hosting-providers" class="">Password Protection (for cloud providers)</a> - Enable password-protection on your site</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="authentication-server">Authentication Server<a href="#authentication-server" class="hash-link" aria-label="Direct link to Authentication Server" title="Direct link to Authentication Server" translate="no"></a></h3>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="authelia">Authelia<a href="#authelia" class="hash-link" aria-label="Direct link to Authelia" title="Direct link to Authelia" translate="no"></a></h4>
<p><a href="https://www.authelia.com/" target="_blank" rel="noopener noreferrer" class="">Authelia</a> is an open-source full-featured authentication server, which can be self-hosted and either on bare metal, in a Docker container or in a Kubernetes cluster. It allows for fine-grained access control rules based on IP, path, users etc, and supports 2FA, simple password access or bypass policies for your domains.</p>
<ul>
<li class=""><code>git clone https://github.com/authelia/authelia.git</code></li>
<li class=""><code>cd authelia/examples/compose/lite</code></li>
<li class="">Modify the <code>users_database.yml</code> the default username and password is authelia</li>
<li class="">Modify the <code>configuration.yml</code> and <code>docker-compose.yml</code> with your respective domains and secrets</li>
<li class=""><code>docker-compose up -d</code></li>
</ul>
<p>For more information, see the <a href="https://www.authelia.com/docs/" target="_blank" rel="noopener noreferrer" class="">Authelia docs</a></p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="vpn">VPN<a href="#vpn" class="hash-link" aria-label="Direct link to VPN" title="Direct link to VPN" translate="no"></a></h3>
<p>A catch-all solution to accessing services running from your home network remotely is to use a VPN. It means you do not need to worry about implementing complex authentication rules, or trusting the login implementation of individual applications. However it can be inconvenient to use on a day-to-day basis, and some public and corporate WiFi block VPN connections. Two popular VPN protocols are <a href="https://openvpn.net/" target="_blank" rel="noopener noreferrer" class="">OpenVPN</a> and <a href="https://www.wireguard.com/" target="_blank" rel="noopener noreferrer" class="">WireGuard</a></p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="ip-based-access">IP-Based Access<a href="#ip-based-access" class="hash-link" aria-label="Direct link to IP-Based Access" title="Direct link to IP-Based Access" translate="no"></a></h3>
<p>If you have a static IP or use a VPN to access your running services, then you can use conditional access to block access to Dashy from everyone except users of your pre-defined IP address. This feature is offered by most cloud providers, and supported by most web servers.</p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="apache">Apache<a href="#apache" class="hash-link" aria-label="Direct link to Apache" title="Direct link to Apache" translate="no"></a></h4>
<p>In Apache, this is configured in your <code>.htaccess</code> file in Dashy&#x27;s root folder, and should look something like:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Order Deny,Allow</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Deny from all</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Allow from [your-ip]</span><br></span></code></pre></div></div>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="nginx">NGINX<a href="#nginx" class="hash-link" aria-label="Direct link to NGINX" title="Direct link to NGINX" translate="no"></a></h4>
<p>In NGINX you can specify <a href="https://docs.nginx.com/nginx/admin-guide/security-controls/controlling-access-proxied-http/" target="_blank" rel="noopener noreferrer" class="">control access</a> rules for a given site in your <code>nginx.conf</code> or hosts file. For example:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">server {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> listen 8080;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> server_name www.dashy.example.com;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> location / {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> root /path/to/dashy/;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> passenger_enabled on;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> allow [your-ip];</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deny all;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> }</span><br></span></code></pre></div></div>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="caddy">Caddy<a href="#caddy" class="hash-link" aria-label="Direct link to Caddy" title="Direct link to Caddy" translate="no"></a></h4>
<p>In Caddy, <a href="https://caddyserver.com/docs/caddyfile/matchers" target="_blank" rel="noopener noreferrer" class="">Request Matchers</a> can be used to filter requests</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">dashy.site {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> @public_networks not remote_ip [your-ip]</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> respond @public_networks &quot;Access denied&quot; 403</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="web-server-authentication">Web Server Authentication<a href="#web-server-authentication" class="hash-link" aria-label="Direct link to Web Server Authentication" title="Direct link to Web Server Authentication" translate="no"></a></h3>
<p>Most web servers make password protecting certain apps very easy. Note that you should also set up HTTPS and have a valid certificate in order for this to be secure.</p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="apache-1">Apache<a href="#apache-1" class="hash-link" aria-label="Direct link to Apache" title="Direct link to Apache" translate="no"></a></h4>
<p>First crate a <code>.htaccess</code> file in Dashy&#x27;s route directory. Specify the auth type and path to where you want to store the password file (usually the same folder). For example:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">AuthType Basic</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">AuthName &quot;Please Sign into Dashy&quot;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">AuthUserFile /path/dashy/.htpasswd</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">require valid-user</span><br></span></code></pre></div></div>
<p>Then create a <code>.htpasswd</code> file in the same directory. List users and their hashed passwords here, with one user on each line, and a colon between username and password (e.g. <code>[username]:[hashed-password]</code>). You will need to generate an MD5 hash of your desired password, this can be done with an <a href="https://www.web2generators.com/apache-tools/htpasswd-generator" target="_blank" rel="noopener noreferrer" class="">online tool</a>. Your file will look something like:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">alicia:$apr1$jv0spemw$RzOX5/GgY69JMkgV6u16l0</span><br></span></code></pre></div></div>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="nginx-1">NGINX<a href="#nginx-1" class="hash-link" aria-label="Direct link to NGINX" title="Direct link to NGINX" translate="no"></a></h4>
<p>NGINX has an <a href="https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html" target="_blank" rel="noopener noreferrer" class="">authentication module</a> which can be used to add passwords to given sites, and is fairly simple to set up. Similar to above, you will need to create a <code>.htpasswd</code> file. Then just enable auth and specify the path to that file, for example:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">location / {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> auth_basic &quot;closed site&quot;;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> auth_basic_user_file conf/htpasswd;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre></div></div>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="caddy-1">Caddy<a href="#caddy-1" class="hash-link" aria-label="Direct link to Caddy" title="Direct link to Caddy" translate="no"></a></h4>
<p>Caddy has a <a href="https://caddyserver.com/docs/caddyfile/directives/basicauth" target="_blank" rel="noopener noreferrer" class="">basic-auth</a> directive, where you specify a username and hash. The password hash needs to be base-64 encoded, the <a href="https://caddyserver.com/docs/command-line#caddy-hash-password" target="_blank" rel="noopener noreferrer" class=""><code>caddy hash-password</code></a> command can help with this. For example:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">basicauth /secret/* {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> alicia JDJhJDEwJEVCNmdaNEg2Ti5iejRMYkF3MFZhZ3VtV3E1SzBWZEZ5Q3VWc0tzOEJwZE9TaFlZdEVkZDhX</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre></div></div>
<p>For more info about implementing a single sign on for all your apps with Caddy, see <a href="https://joshstrange.com/securing-your-self-hosted-apps-with-single-signon/" target="_blank" rel="noopener noreferrer" class="">this tutorial</a></p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="lighttpd">Lighttpd<a href="#lighttpd" class="hash-link" aria-label="Direct link to Lighttpd" title="Direct link to Lighttpd" translate="no"></a></h4>
<p>You can use the <a href="https://doc.lighttpd.net/lighttpd2/mod_auth.html" target="_blank" rel="noopener noreferrer" class="">mod_auth</a> module to secure your site with Lighttpd. Like with Apache, you need to first create a password file listing your usernames and hashed passwords, but in Lighttpd, it&#x27;s usually called <code>.lighttpdpassword</code>.</p>
<p>Then in your <code>lighttpd.conf</code> file (usually in the <code>/etc/lighttpd/</code> directory), load in the mod_auth module, and configure it&#x27;s directives. For example:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">server.modules += ( &quot;mod_auth&quot; )</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">auth.debug = 2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">auth.backend = &quot;plain&quot;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">auth.backend.plain.userfile = &quot;/home/lighttpd/.lighttpdpassword&quot;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">$HTTP[&quot;host&quot;] == &quot;dashy.my-domain.net&quot; {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> server.document-root = &quot;/home/lighttpd/dashy.my-domain.net/http&quot;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> server.errorlog = &quot;/var/log/lighttpd/dashy.my-domain.net/error.log&quot;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> accesslog.filename = &quot;/var/log/lighttpd/dashy.my-domain.net/access.log&quot;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> auth.require = (</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> &quot;/docs/&quot; =&gt; (</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> &quot;method&quot; =&gt; &quot;basic&quot;,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> &quot;realm&quot; =&gt; &quot;Password protected area&quot;,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> &quot;require&quot; =&gt; &quot;user=alicia&quot;</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> )</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> )</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre></div></div>
<p>Restart your web server for changes to take effect.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="oauth-services">OAuth Services<a href="#oauth-services" class="hash-link" aria-label="Direct link to OAuth Services" title="Direct link to OAuth Services" translate="no"></a></h3>
<p>There are also authentication services, such as <a href="https://www.ory.sh/" target="_blank" rel="noopener noreferrer" class="">Ory.sh</a>, <a href="https://developer.okta.com/" target="_blank" rel="noopener noreferrer" class="">Okta</a>, <a href="https://auth0.com/" target="_blank" rel="noopener noreferrer" class="">Auth0</a>, <a href="https://firebase.google.com/docs/auth/" target="_blank" rel="noopener noreferrer" class="">Firebase</a>. Implementing one of these solutions would involve some changes to the <a href="https://github.com/Lissy93/dashy/blob/master/src/utils/Auth.js" target="_blank" rel="noopener noreferrer" class=""><code>Auth.js</code></a> file, but should be fairly straightforward.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="static-site-hosting-providers">Static Site Hosting Providers<a href="#static-site-hosting-providers" class="hash-link" aria-label="Direct link to Static Site Hosting Providers" title="Direct link to Static Site Hosting Providers" translate="no"></a></h3>
<p>If you are hosting Dashy on a cloud platform, you will probably find that it has built-in support for password protected access to web apps. For more info, see the relevant docs for your provider, for example: <a href="https://docs.netlify.com/visitor-access/password-protection/" target="_blank" rel="noopener noreferrer" class="">Netlify Password Protection</a>, <a href="https://www.cloudflare.com/teams/access/" target="_blank" rel="noopener noreferrer" class="">Cloudflare Access</a>, <a href="https://aws.amazon.com/cognito/" target="_blank" rel="noopener noreferrer" class="">AWS Cognito</a>, <a href="https://docs.microsoft.com/en-us/azure/app-service/scenario-secure-app-authentication-app-service" target="_blank" rel="noopener noreferrer" class="">Azure Authentication</a> and <a href="https://vercel.com/docs/platform/projects#password-protection" target="_blank" rel="noopener noreferrer" class="">Vercel Password Protection</a>.</p>
<p><strong><strong><a href="#" class="">⬆️ Back to Top</a></strong></strong></p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col noPrint_WFHX"><a href="https://github.com/Lissy93/dashy/edit/gh-pages/docs/docs/authentication.md" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_JAkA"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2026-03-13T09:25:41.000Z" itemprop="dateModified">Mar 13, 2026</time></b></span></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/status-indicators"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Status Indicators</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/searching"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Keyboard Shortcuts</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#built-in-auth" class="table-of-contents__link toc-highlight">Built-In Auth</a><ul><li><a href="#setting-up-authentication" class="table-of-contents__link toc-highlight">Setting Up Authentication</a></li><li><a href="#hash-password" class="table-of-contents__link toc-highlight">Hash Password</a></li><li><a href="#logging-in-and-out" class="table-of-contents__link toc-highlight">Logging In and Out</a></li><li><a href="#enabling-guest-access" class="table-of-contents__link toc-highlight">Enabling Guest Access</a></li><li><a href="#granular-access" class="table-of-contents__link toc-highlight">Granular Access</a></li><li><a href="#permissions" class="table-of-contents__link toc-highlight">Permissions</a></li><li><a href="#using-environment-variables-for-passwords" class="table-of-contents__link toc-highlight">Using Environment Variables for Passwords</a></li><li><a href="#adding-http-auth-to-configuration" class="table-of-contents__link toc-highlight">Adding HTTP Auth to Configuration</a></li><li><a href="#security" class="table-of-contents__link toc-highlight">Security</a></li></ul></li><li><a href="#http-auth" class="table-of-contents__link toc-highlight">HTTP Auth</a></li><li><a href="#keycloak" class="table-of-contents__link toc-highlight">Keycloak</a><ul><li><a href="#1-deploy-keycloak" class="table-of-contents__link toc-highlight">1. Deploy Keycloak</a></li><li><a href="#2-setup-keycloak-users" class="table-of-contents__link toc-highlight">2. Setup Keycloak Users</a></li><li><a href="#3-enable-keycloak-in-dashy-config-file" class="table-of-contents__link toc-highlight">3. Enable Keycloak in Dashy Config File</a></li><li><a href="#4-add-groups-and-roles-optional" class="table-of-contents__link toc-highlight">4. Add groups and roles (Optional)</a></li><li><a href="#troubleshooting-keycloak" class="table-of-contents__link toc-highlight">Troubleshooting Keycloak</a></li></ul></li><li><a href="#oidc" class="table-of-contents__link toc-highlight">OIDC</a><ul><li><a href="#authentik" class="table-of-contents__link toc-highlight">authentik</a></li></ul></li><li><a href="#alternative-authentication-methods" class="table-of-contents__link toc-highlight">Alternative Authentication Methods</a><ul><li><a href="#authentication-server" class="table-of-contents__link toc-highlight">Authentication Server</a></li><li><a href="#vpn" class="table-of-contents__link toc-highlight">VPN</a></li><li><a href="#ip-based-access" class="table-of-contents__link toc-highlight">IP-Based Access</a></li><li><a href="#web-server-authentication" class="table-of-contents__link toc-highlight">Web Server Authentication</a></li><li><a href="#oauth-services" class="table-of-contents__link toc-highlight">OAuth Services</a></li><li><a href="#static-site-hosting-providers" class="table-of-contents__link toc-highlight">Static Site Hosting Providers</a></li></ul></li></ul></div></div></div></div></main></div></div></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="theme-layout-footer-column col footer__col"><div class="footer__title">Intro</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/lissy93/dashy" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_nPIU"><use href="#theme-svg-external-link"></use></svg></a></li><li class="footer__item"><a href="https://demo.dashy.to" target="_blank" rel="noopener noreferrer" class="footer__link-item">Live Demo<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_nPIU"><use href="#theme-svg-external-link"></use></svg></a></li><li class="footer__item"><a class="footer__link-item" href="/docs/quick-start">Quick Start</a></li><li class="footer__item"><a class="footer__link-item" href="/docs">Documentation</a></li></ul></div><div class="theme-layout-footer-column col footer__col"><div class="footer__title">Setup Guide</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/deployment">Deploying</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/configuring">Configuring</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/management">Management</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/troubleshooting">Troubleshooting</a></li></ul></div><div class="theme-layout-footer-column col footer__col"><div class="footer__title">Feature Docs Pt 1</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/authentication">Authentication</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/alternate-views">Alternate Views</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/backup-restore">Backup &amp; Restore</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/icons">Icons</a></li></ul></div><div class="theme-layout-footer-column col footer__col"><div class="footer__title">Feature Docs Pt 2</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/multi-language-support">Language Switching</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/status-indicators">Status Indicators</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/searching">Searching &amp; Shortcuts</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/theming">Theming</a></li></ul></div><div class="theme-layout-footer-column col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/developing">Developing</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/development-guides">Development Guides</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/contributing">Contributing</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/showcase">Showcase</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/credits">Credits</a></li></ul></div><div class="theme-layout-footer-column col footer__col"><div class="footer__title">Misc</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/privacy">Privacy &amp; Security</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/license">License</a></li><li class="footer__item"><a href="https://github.com/Lissy93/dashy/blob/master/.github/LEGAL.md" target="_blank" rel="noopener noreferrer" class="footer__link-item">Legal<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_nPIU"><use href="#theme-svg-external-link"></use></svg></a></li><li class="footer__item"><a href="https://github.com/Lissy93/dashy/blob/master/.github/CODE_OF_CONDUCT.md" target="_blank" rel="noopener noreferrer" class="footer__link-item">Code of Conduct<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_nPIU"><use href="#theme-svg-external-link"></use></svg></a></li><li class="footer__item"><a href="https://github.com/Lissy93/dashy/blob/master/.github/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="footer__link-item">Changelog<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_nPIU"><use href="#theme-svg-external-link"></use></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><a href="https://dashy.to">Dashy</a> - The Self-Hosted Dashboard for your Homelab<br>License under <a href="https://github.com/Lissy93/dashy/blob/master/LICENSE">MIT</a>. Copyright © 2026 <a href="https://aliciasykes.com">Alicia Sykes</a></div></div></div></footer></div>
</body>
</html>