Files
windmill/frontend/src/lib/components/CustomOauth.svelte
59a8657426 feat: clarify OAuth connect levels and client credential sharing (#11820)
* [ee] feat: clarify OAuth connect levels and client credential sharing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: show the share warning only once credentials are set

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: accept per-instance OAuth entries saved with explicit URLs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: reject an empty instance name, skip identity icons the grant can't tell, gate the test button on EE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep hand-written URLs of per-instance OAuth entries on save

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: name OAuth grants plainly in the resource drawer and settings

The instance settings label each grant by its OAuth name, as the provider's
console does. The resource drawer leads with what each option does (log in
with your account, connect as an app), keeps the grant name as a hint, and
names the provider by its display name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: test client credentials on a copy and keep hand-written token URLs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: accept the Teams tenant when validating OAuth settings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: give client credentials its own section in the OAuth settings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: lay out every OAuth provider card in the same three sections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: organise OAuth provider cards around the app and name sharing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4rzFqwJ3NEP729jYHMWSS

* fix: warn when sharing stops, check only changed OAuth entries

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4rzFqwJ3NEP729jYHMWSS

* fix: drop the extra line on the Others provider row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4rzFqwJ3NEP729jYHMWSS

* fix: always show the OAuth redirect URL and name the client credentials capability

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4rzFqwJ3NEP729jYHMWSS

* fix: show client credentials support as set while sharing, reword OAuth hints

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4rzFqwJ3NEP729jYHMWSS

* chore: update ee-repo-ref to db10448ac8c55485b4eeaa1e7c3281a9e0bb2544

This commit updates the EE repository reference after PR #890 was merged in windmill-ee-private.

Previous ee-repo-ref: b9ed2a3aa3fb443be5241e28456e07e81b5dfc88

New ee-repo-ref: db10448ac8c55485b4eeaa1e7c3281a9e0bb2544

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2026-11-13 13:12:10 +01:00

101 lines
3.2 KiB
Svelte

<script lang="ts">
import { run } from 'svelte/legacy'
import OauthExtraParams from './OauthExtraParams.svelte'
import OauthScopes from './OauthScopes.svelte'
import Toggle from './Toggle.svelte'
import Tooltip from './Tooltip.svelte'
let {
connect_config = $bindable(),
requireAuthUrl = false,
requireTokenUrl = false
}: {
connect_config: any
/** A way that is on needs this URL: an empty one is flagged under its field. */
requireAuthUrl?: boolean
requireTokenUrl?: boolean
} = $props()
run(() => {
if (!connect_config) {
connect_config = {
scopes: [],
auth_url: '',
token_url: '',
req_body_auth: false,
extra_params: {},
extra_params_callback: {}
}
}
})
</script>
<div class="flex flex-col gap-6">
<label class="flex flex-col gap-1">
<span class="text-emphasis font-semibold text-xs"
>Auth URL <Tooltip
>Leave empty for providers that only support the client credentials flow: the provider is
then offered exclusively with server-to-server authentication.</Tooltip
></span
>
<input
type="text"
placeholder="https://github.com/login/oauth/authorize"
bind:value={connect_config.auth_url}
/>
{#if requireAuthUrl && !connect_config.auth_url}
<span class="text-2xs text-red-500">Add the auth URL to use this provider.</span>
{/if}
</label>
<label class="flex flex-col gap-1">
<span class="text-emphasis font-semibold text-xs"> Token URL</span>
<input
type="text"
placeholder="https://github.com/login/oauth/access_token"
bind:value={connect_config.token_url}
/>
{#if requireTokenUrl && !connect_config.token_url}
<span class="text-2xs text-red-500">Add the token URL to use this provider.</span>
{/if}
</label>
<!-- svelte-ignore a11y_label_has_associated_control -->
<label class="flex flex-col gap-1">
<span class="text-emphasis font-semibold text-xs">Scopes</span>
<OauthScopes bind:scopes={connect_config.scopes} />
</label>
<!-- svelte-ignore a11y_label_has_associated_control -->
<label class="flex flex-col gap-1">
<span class="text-emphasis font-semibold text-xs"
>Extra Query Args for Authorize Request&nbsp;<Tooltip
>Not needed in most cases. Examples of uses: google apis require the 2 extra args
"access_type=offline&prompt=consent"</Tooltip
></span
>
<OauthExtraParams bind:extra_params={connect_config.extra_params} />
</label>
<!-- svelte-ignore a11y_label_has_associated_control -->
<label class="flex flex-col gap-1">
<span class="text-emphasis font-semibold text-xs"
>Extra Query Args for Token request <Tooltip>Not needed in most cases</Tooltip></span
>
<OauthExtraParams bind:extra_params={connect_config.extra_params_callback} />
</label>
<!-- svelte-ignore a11y_label_has_associated_control -->
<label class="flex flex-col gap-1">
<span class="text-emphasis font-semibold text-xs"
>Payload <Tooltip
>Auth (client id/client secret) is passed as basic auth most commonly but can be passed in
the body x-www-form-urlencoded. Some LinkedIn is an example of OAuth using
x-www-form-urlencoded
</Tooltip></span
>
<div>
<Toggle
options={{ left: 'in query args', right: 'in body x-www-form-urlencoded' }}
bind:checked={connect_config.req_body_auth}
/></div
>
</label>
</div>