From 3d8dee9e6ac10a59caf8e1ef9eff077fd78d2e20 Mon Sep 17 00:00:00 2001 From: Rudo Kemper <31662219+rudokemper@users.noreply.github.com> Date: Sun, 9 Feb 2025 22:54:55 -0500 Subject: [PATCH] fix: Support authentication with auth0 (#5249) --- .../src/lib/components/Auth0Setting.svelte | 102 ++++++++++++++++++ .../src/lib/components/AuthSettings.svelte | 4 +- frontend/src/lib/components/Login.svelte | 6 ++ .../src/lib/components/icons/Auth0Icon.svelte | 18 ++++ .../lib/components/icons/brands/Auth0.svelte | 26 +++++ frontend/src/lib/components/icons/index.ts | 3 + 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 frontend/src/lib/components/Auth0Setting.svelte create mode 100644 frontend/src/lib/components/icons/Auth0Icon.svelte create mode 100644 frontend/src/lib/components/icons/brands/Auth0.svelte diff --git a/frontend/src/lib/components/Auth0Setting.svelte b/frontend/src/lib/components/Auth0Setting.svelte new file mode 100644 index 0000000000..5ff0781c72 --- /dev/null +++ b/frontend/src/lib/components/Auth0Setting.svelte @@ -0,0 +1,102 @@ + + +
+ + + {#if enabled} +
+ + + + + +
+ From your Admin page, setup a Windmill application
+ Create a new application
+ For "application type" select "Regular Web Application"
+ Copy down the "Client ID" and "Client Secret" and paste them into the fields above
+ Under "Application URIs", set the following:
+ a. Application Login URI: `BASE_URL/user/login`
+ b. Allowed Callback URLs: `BASE_URL/user/login_callback/auth0`
+ c. Allowed Logout URLs: `BASE_URL/auth/logout`
+ d. Allowed Web Origins: `BASE_URL`
+ e. Allowed Origins (CORS): `BASE_URL`
+
+
+
+ {/if} +
diff --git a/frontend/src/lib/components/AuthSettings.svelte b/frontend/src/lib/components/AuthSettings.svelte index 195e760114..f6db65526a 100644 --- a/frontend/src/lib/components/AuthSettings.svelte +++ b/frontend/src/lib/components/AuthSettings.svelte @@ -4,6 +4,7 @@ import OAuthSetting from '$lib/components/OAuthSetting.svelte' import OktaSetting from './OktaSetting.svelte' + import Auth0Setting from './Auth0Setting.svelte' import CloseButton from './common/CloseButton.svelte' import KeycloakSetting from './KeycloakSetting.svelte' import CustomSso from './CustomSso.svelte' @@ -81,6 +82,7 @@ + @@ -90,7 +92,7 @@ {#each Object.keys(oauths) as k} - {#if !['authelia', 'authentik', 'google', 'microsoft', 'github', 'gitlab', 'jumpcloud', 'okta', 'keycloak', 'slack', 'kanidm', 'zitadel'].includes(k) && 'login_config' in oauths[k]} + {#if !['authelia', 'authentik', 'google', 'microsoft', 'github', 'gitlab', 'jumpcloud', 'okta', 'auth0', 'keycloak', 'slack', 'kanidm', 'zitadel'].includes(k) && 'login_config' in oauths[k]} {#if oauths[k]}
diff --git a/frontend/src/lib/components/Login.svelte b/frontend/src/lib/components/Login.svelte index 8b073e4d8a..3046afd53c 100644 --- a/frontend/src/lib/components/Login.svelte +++ b/frontend/src/lib/components/Login.svelte @@ -5,6 +5,7 @@ import Google from '$lib/components/icons/brands/Google.svelte' import Microsoft from '$lib/components/icons/brands/Microsoft.svelte' import Okta from '$lib/components/icons/brands/Okta.svelte' + import Auth0 from '$lib/components/icons/brands/Auth0.svelte' import { OauthService, UserService, WorkspaceService } from '$lib/gen' import { usersWorkspaceStore, workspaceStore, userStore } from '$lib/stores' @@ -49,6 +50,11 @@ type: 'okta', name: 'Okta', icon: Okta + }, + { + type: 'auth0', + name: 'Auth0', + icon: Auth0 } ] as const diff --git a/frontend/src/lib/components/icons/Auth0Icon.svelte b/frontend/src/lib/components/icons/Auth0Icon.svelte new file mode 100644 index 0000000000..bf6ae23b48 --- /dev/null +++ b/frontend/src/lib/components/icons/Auth0Icon.svelte @@ -0,0 +1,18 @@ + + auth0ddd-svg + + + diff --git a/frontend/src/lib/components/icons/brands/Auth0.svelte b/frontend/src/lib/components/icons/brands/Auth0.svelte new file mode 100644 index 0000000000..43e0a89880 --- /dev/null +++ b/frontend/src/lib/components/icons/brands/Auth0.svelte @@ -0,0 +1,26 @@ + + + + auth0ddd-svg + + + diff --git a/frontend/src/lib/components/icons/index.ts b/frontend/src/lib/components/icons/index.ts index adc460624b..20c541a14c 100644 --- a/frontend/src/lib/components/icons/index.ts +++ b/frontend/src/lib/components/icons/index.ts @@ -68,6 +68,7 @@ import GraphqlIcon from './GraphqlIcon.svelte' import NocoDbIcon from './NocoDbIcon.svelte' import AzureIcon from './AzureIcon.svelte' import OktaIcon from './OktaIcon.svelte' +import Auth0Icon from './Auth0Icon.svelte' import MsSqlServerIcon from './MSSqlServerIcon.svelte' import AuthentikIcon from './AuthentikIcon.svelte' import AutheliaIcon from './AutheliaIcon.svelte' @@ -170,6 +171,7 @@ export const APP_TO_ICON_COMPONENT = { nocodb: NocoDbIcon, azure: AzureIcon, okta: OktaIcon, + auth0: Auth0Icon, authentik: AuthentikIcon, authelia: AutheliaIcon, kanidm: KanidmIcon, @@ -268,6 +270,7 @@ export { AzureIcon, MicrosoftIcon, OktaIcon, + Auth0Icon, AuthentikIcon, AutheliaIcon, KanidmIcon,