Browse Source

Added UI for SSO

Toby Chui 6 months ago
parent
commit
84396d72d2
2 changed files with 64 additions and 6 deletions
  1. 41 6
      web/components/sso.html
  2. 23 0
      web/main.css

+ 41 - 6
web/components/sso.html

@@ -1,10 +1,45 @@
 <div class="standardContainer">
     <div class="ui basic segment">
-        <h2>Single-Sign-On</h2>
-        <p>Create and manage accounts with Zoraxy!</p>
-    </div>
-    <div class="ui message">
-        <h4>Work In Progress</h4>
-        We are looking for someone to help with implementing this feature in Zoraxy. <br>If you know how to write Golang and want to contribute, feel free to create a pull request to this feature!
+        <h2>Single-Sign-On / Zoraxy SSO</h2>
+        <p>A centralized authentication system for all your subdomains</p>
+        <div class="ui divider"></div>
+        <div class="ui basic segment enabled ssoRunningState">
+            <h4 class="ui header" id="ssoRunningState">
+                <i class="circle check icon"></i>
+                <div class="content">
+                    <span class="webserv_status">Running</span>
+                    <div class="sub header">Listen port :<span class="webserv_port">8081</span></div>
+                </div>
+            </h4>
+        </div>
+        <div class="ui form">
+            
+            <div class="field">
+                <div class="ui toggle checkbox">
+                    <input type="checkbox" name="enableOauth2">
+                    <label>Enable Oauth2 Server<br>
+                    <small>Oauth2 server for handling external authentication requests</small></label>
+                </div>
+            </div>
+            <div class="field">
+                <label>Oauth2 Server Port</label>
+                <input type="number" name="oauth2Port" placeholder="Port" value="5488">
+            </div>
+            <div class="field">
+                <div class="ui toggle checkbox">
+                    <input type="checkbox" name="enableZoraxySSO">
+                    <label>Enable Zoraxy SSO<br>
+                    <small>Use Zoraxy SSO credentials with upstreams that do not support oauth</small></label>
+                </div>
+            </div>
+            <div class="field">
+                <label>SSO Server Port</label>
+                <input type="number" name="ssoPort" placeholder="Port" value="8081">
+            </div>
+            <div class="field">
+                <label>SSO Token Expiry</label>
+                <input type="number" name="ssoTokenExpiry" placeholder="Token Expiry" value="3600">
+            </div>
+        </div>
     </div>
 </div>  

+ 23 - 0
web/main.css

@@ -614,6 +614,29 @@ body{
     background: var(--theme_green) !important;
 }
 
+/*
+    SSO Panel
+*/
+
+.ssoRunningState{
+    padding: 1em;
+    border-radius: 1em !important;
+}
+
+
+.ssoRunningState .ui.header, .ssoRunningState .sub.header{
+    color: white !important;
+}
+
+.ssoRunningState:not(.enabled){
+    background: var(--theme_red) !important;
+}
+
+.ssoRunningState.enabled{
+    background: var(--theme_green) !important;
+}
+
+
 /*
     Static Web Server
 */