From 53abcbe90f1f77deb9b9b22d5aee039599f6f32a Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 27 Apr 2023 19:06:12 -0700 Subject: [PATCH] Add a generic OIDC OAuth2 provider --- src/lib/stores/oauth-providers.ts | 11 +- .../project-[project]/auth/oidcOAuth.svelte | 127 ++++++++++++++++++ static/icons/dark/color/oidc.svg | 4 + static/icons/dark/grayscale/oidc.svg | 4 + static/icons/light/color/oidc.svg | 4 + static/icons/light/grayscale/oidc.svg | 4 + 6 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 src/routes/console/project-[project]/auth/oidcOAuth.svelte create mode 100644 static/icons/dark/color/oidc.svg create mode 100644 static/icons/dark/grayscale/oidc.svg create mode 100644 static/icons/light/color/oidc.svg create mode 100644 static/icons/light/grayscale/oidc.svg diff --git a/src/lib/stores/oauth-providers.ts b/src/lib/stores/oauth-providers.ts index 40bcff26a..fbdd710cb 100644 --- a/src/lib/stores/oauth-providers.ts +++ b/src/lib/stores/oauth-providers.ts @@ -1,14 +1,15 @@ -import { writable } from 'svelte/store'; import type { Models } from '@appwrite.io/console'; import type { SvelteComponent } from 'svelte'; +import { writable } from 'svelte/store'; import Apple from '../../routes/console/project-[project]/auth/appleOAuth.svelte'; -import Microsoft from '../../routes/console/project-[project]/auth/microsoftOAuth.svelte'; -import Okta from '../../routes/console/project-[project]/auth/oktaOAuth.svelte'; import Auth0 from '../../routes/console/project-[project]/auth/auth0OAuth.svelte'; import Authentik from '../../routes/console/project-[project]/auth/authentikOAuth.svelte'; import GitLab from '../../routes/console/project-[project]/auth/gitlabOAuth.svelte'; import Google from '../../routes/console/project-[project]/auth/googleOAuth.svelte'; import Main from '../../routes/console/project-[project]/auth/mainOAuth.svelte'; +import Microsoft from '../../routes/console/project-[project]/auth/microsoftOAuth.svelte'; +import Oidc from '../../routes/console/project-[project]/auth/oidcOAuth.svelte'; +import Okta from '../../routes/console/project-[project]/auth/oktaOAuth.svelte'; export type Provider = Models.Provider & { icon: string; @@ -94,6 +95,10 @@ const setProviders = (project: Models.Project): Provider[] => { case 'notion': docs = 'https://developers.notion.com/docs'; break; + case 'oidc': + docs = 'https://openid.net/connect/faq/'; + component = Oidc; + break; case 'okta': docs = 'https://developer.okta.com'; component = Okta; diff --git a/src/routes/console/project-[project]/auth/oidcOAuth.svelte b/src/routes/console/project-[project]/auth/oidcOAuth.svelte new file mode 100644 index 000000000..8c3db7df6 --- /dev/null +++ b/src/routes/console/project-[project]/auth/oidcOAuth.svelte @@ -0,0 +1,127 @@ + + + + {provider.name.toUpperCase()} OAuth2 Settings + +

+ To use {provider.name.toUpperCase()} authentication in your application, first fill in this + form. For more info you can + visit the docs. +

+ + + + + + + + + + To complete set up, add this OAuth2 redirect URI to your {provider.name} app configuration. + +
+

URI

+ +
+
+ + + + +
diff --git a/static/icons/dark/color/oidc.svg b/static/icons/dark/color/oidc.svg new file mode 100644 index 000000000..0eb22aad2 --- /dev/null +++ b/static/icons/dark/color/oidc.svg @@ -0,0 +1,4 @@ + + + + diff --git a/static/icons/dark/grayscale/oidc.svg b/static/icons/dark/grayscale/oidc.svg new file mode 100644 index 000000000..f3a6a0937 --- /dev/null +++ b/static/icons/dark/grayscale/oidc.svg @@ -0,0 +1,4 @@ + + + + diff --git a/static/icons/light/color/oidc.svg b/static/icons/light/color/oidc.svg new file mode 100644 index 000000000..0eb22aad2 --- /dev/null +++ b/static/icons/light/color/oidc.svg @@ -0,0 +1,4 @@ + + + + diff --git a/static/icons/light/grayscale/oidc.svg b/static/icons/light/grayscale/oidc.svg new file mode 100644 index 000000000..84da2cb78 --- /dev/null +++ b/static/icons/light/grayscale/oidc.svg @@ -0,0 +1,4 @@ + + + +