feat(apps): Log in to wg-easy with authentik OIDC

This commit is contained in:
2026-10-10 01:46:35 +05:30
parent 40df38dd8d
commit 01ddf5937b
8 changed files with 75 additions and 51 deletions
+30 -14
View File
@@ -104,15 +104,41 @@ data:
metadata:
name: WireGuard admin
entries:
- model: authentik_providers_proxy.proxyprovider
# wg-easy rejects logins unless email_verified is true; the default email
# mapping always sends false.
- model: authentik_providers_oauth2.scopemapping
id: verified-email
identifiers:
name: wireguard-admin email
attrs:
scope_name: email
expression: |
return {
"email": request.user.email,
"email_verified": True,
}
- model: authentik_providers_oauth2.oauth2provider
id: wireguard-admin-provider
identifiers:
name: wireguard-admin
attrs:
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
external_host: https://wg-admin.whyredfire.dev
mode: forward_single
client_id: wireguard-admin
client_secret: !Env WIREGUARD_CLIENT_SECRET
grant_types:
- authorization_code
- refresh_token
redirect_uris:
- matching_mode: strict
url: https://wg-admin.whyredfire.dev/api/auth/oidc/callback
- matching_mode: strict
url: https://wg-admin.whyredfire.dev/api/auth/oidc/link
signing_key: !Find [authentik_crypto.certificatekeypair, [name, authentik Self-signed Certificate]]
property_mappings:
- !Find [authentik_providers_oauth2.scopemapping, [managed, goauthentik.io/providers/oauth2/scope-openid]]
- !KeyOf verified-email
- !Find [authentik_providers_oauth2.scopemapping, [managed, goauthentik.io/providers/oauth2/scope-profile]]
- model: authentik_core.application
id: wireguard-admin
identifiers:
@@ -121,20 +147,10 @@ data:
name: WireGuard Admin
provider: !KeyOf wireguard-admin-provider
meta_launch_url: https://wg-admin.whyredfire.dev
# Issuing VPN clients is admin-only.
# wg-easy makes every user it registers an admin, so only admins may log in.
- model: authentik_policies.policybinding
identifiers:
order: 0
target: !KeyOf wireguard-admin
attrs:
group: !Find [authentik_core.group, [name, admins]]
# This replaces the embedded outpost's provider list, so it also names the
# providers created in the UI.
- model: authentik_outposts.outpost
identifiers:
managed: goauthentik.io/outposts/embedded
attrs:
providers:
- !Find [authentik_providers_proxy.proxyprovider, [name, garage-ui]]
- !Find [authentik_providers_proxy.proxyprovider, [name, qbittorrent]]
- !KeyOf wireguard-admin-provider