added OAuth2 displayName and pkce options

This commit is contained in:
Gani Georgiev
2023-11-29 20:19:54 +02:00
parent 995733000f
commit b283ee2263
65 changed files with 421 additions and 226 deletions
@@ -8,5 +8,5 @@
<div class="content txt-hint txt-center p-base">
<h3 class="m-b-sm">Auth completed.</h3>
<h5>You can go back to the app if this window is not automatically closed.</h5>
<h5>You can close this window and go back to the app.</h5>
</div>
@@ -0,0 +1,48 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
export let key = "";
export let config = {};
if (CommonHelper.isEmpty(config.pkce)) {
config.pkce = true;
}
if (!config.displayName) {
config.displayName = "OIDC";
}
</script>
<Field class="form-field required" name="{key}.displayName" let:uniqueId>
<label for={uniqueId}>Display name</label>
<input type="text" id={uniqueId} bind:value={config.displayName} required />
</Field>
<div class="section-title">Endpoints</div>
<Field class="form-field required" name="{key}.authUrl" let:uniqueId>
<label for={uniqueId}>Auth URL</label>
<input type="url" id={uniqueId} bind:value={config.authUrl} required />
</Field>
<Field class="form-field required" name="{key}.tokenUrl" let:uniqueId>
<label for={uniqueId}>Token URL</label>
<input type="url" id={uniqueId} bind:value={config.tokenUrl} required />
</Field>
<Field class="form-field required" name="{key}.userApiUrl" let:uniqueId>
<label for={uniqueId}>User API URL</label>
<input type="url" id={uniqueId} bind:value={config.userApiUrl} required />
</Field>
<Field class="form-field" name="{key}.pkce" let:uniqueId>
<input type="checkbox" id={uniqueId} bind:checked={config.pkce} />
<label for={uniqueId}>
<span class="txt">Support PKCE</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: "Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if PKCE is not supported by their APIs.",
position: "right",
}}
/>
</label>
</Field>
+4 -6
View File
@@ -1,4 +1,5 @@
import SelfHostedOptions from "@/components/settings/providers/SelfHostedOptions.svelte";
import OIDCOptions from "@/components/settings/providers/OIDCOptions.svelte";
import MicrosoftOptions from "@/components/settings/providers/MicrosoftOptions.svelte";
import AppleOptions from "@/components/settings/providers/AppleOptions.svelte";
@@ -126,21 +127,18 @@ export default [
key: "oidcAuth",
title: "OpenID Connect",
logo: "oidc.svg",
optionsComponent: SelfHostedOptions,
optionsComponentProps: { required: true },
optionsComponent: OIDCOptions,
},
{
key: "oidc2Auth",
title: "(2) OpenID Connect",
logo: "oidc.svg",
optionsComponent: SelfHostedOptions,
optionsComponentProps: { required: true },
optionsComponent: OIDCOptions,
},
{
key: "oidc3Auth",
title: "(3) OpenID Connect",
logo: "oidc.svg",
optionsComponent: SelfHostedOptions,
optionsComponentProps: { required: true },
optionsComponent: OIDCOptions,
},
];