Allow custom text and icon for Keycloak (#3181)
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
parent
77906bc817
commit
e750165cc3
9 changed files with 47 additions and 9 deletions
|
|
@ -167,6 +167,8 @@ GITHUB_CLIENT_SECRET=""
|
||||||
KEYCLOAK_CLIENT_ID=""
|
KEYCLOAK_CLIENT_ID=""
|
||||||
KEYCLOAK_CLIENT_SECRET=""
|
KEYCLOAK_CLIENT_SECRET=""
|
||||||
KEYCLOAK_DISCOVERY_URL=""
|
KEYCLOAK_DISCOVERY_URL=""
|
||||||
|
KEYCLOAK_CLIENT_CUSTOM_ORG=""
|
||||||
|
KEYCLOAK_CLIENT_CUSTOM_ICON=""
|
||||||
|
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
|
|
|
||||||
|
|
@ -132,8 +132,8 @@
|
||||||
>
|
>
|
||||||
<strong class="q-my-none q-mb-sm">Keycloak Auth</strong>
|
<strong class="q-my-none q-mb-sm">Keycloak Auth</strong>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row q-col-gutter-sm q-col-gutter-y-md">
|
||||||
<div class="col-md-4 col-sm-12 q-pr-sm">
|
<div class="col-md-4 col-sm-12">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
v-model="formData.keycloak_discovery_url"
|
v-model="formData.keycloak_discovery_url"
|
||||||
|
|
@ -141,7 +141,7 @@
|
||||||
>
|
>
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-sm-12 q-pr-sm">
|
<div class="col-md-4 col-sm-12">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
v-model="formData.keycloak_client_id"
|
v-model="formData.keycloak_client_id"
|
||||||
|
|
@ -159,6 +159,22 @@
|
||||||
>
|
>
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-4 col-sm-12">
|
||||||
|
<q-input
|
||||||
|
filled
|
||||||
|
v-model="formData.keycloak_client_custom_org"
|
||||||
|
:label="$t('auth_keycloak_custom_org_label')"
|
||||||
|
>
|
||||||
|
</q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8 col-sm-12">
|
||||||
|
<q-input
|
||||||
|
filled
|
||||||
|
v-model="formData.keycloak_client_custom_icon"
|
||||||
|
:label="$t('auth_keycloak_custom_icon_label')"
|
||||||
|
>
|
||||||
|
</q-input>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator></q-separator>
|
<q-separator></q-separator>
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,8 @@ def template_renderer(additional_folders: Optional[list] = None) -> Jinja2Templa
|
||||||
"LNBITS_ADMIN_UI": settings.lnbits_admin_ui,
|
"LNBITS_ADMIN_UI": settings.lnbits_admin_ui,
|
||||||
"LNBITS_AUDIT_ENABLED": settings.lnbits_audit_enabled,
|
"LNBITS_AUDIT_ENABLED": settings.lnbits_audit_enabled,
|
||||||
"LNBITS_AUTH_METHODS": settings.auth_allowed_methods,
|
"LNBITS_AUTH_METHODS": settings.auth_allowed_methods,
|
||||||
|
"LNBITS_AUTH_KEYCLOAK_ORG": settings.keycloak_client_custom_org,
|
||||||
|
"LNBITS_AUTH_KEYCLOAK_ICON": settings.keycloak_client_custom_icon,
|
||||||
"LNBITS_CUSTOM_IMAGE": settings.lnbits_custom_image,
|
"LNBITS_CUSTOM_IMAGE": settings.lnbits_custom_image,
|
||||||
"LNBITS_CUSTOM_BADGE": settings.lnbits_custom_badge,
|
"LNBITS_CUSTOM_BADGE": settings.lnbits_custom_badge,
|
||||||
"LNBITS_CUSTOM_BADGE_COLOR": settings.lnbits_custom_badge_color,
|
"LNBITS_CUSTOM_BADGE_COLOR": settings.lnbits_custom_badge_color,
|
||||||
|
|
|
||||||
|
|
@ -667,6 +667,8 @@ class KeycloakAuthSettings(LNbitsSettings):
|
||||||
keycloak_discovery_url: str = Field(default="")
|
keycloak_discovery_url: str = Field(default="")
|
||||||
keycloak_client_id: str = Field(default="")
|
keycloak_client_id: str = Field(default="")
|
||||||
keycloak_client_secret: str = Field(default="")
|
keycloak_client_secret: str = Field(default="")
|
||||||
|
keycloak_client_custom_org: str | None = Field(default=None)
|
||||||
|
keycloak_client_custom_icon: str | None = Field(default=None)
|
||||||
|
|
||||||
|
|
||||||
class AuditSettings(LNbitsSettings):
|
class AuditSettings(LNbitsSettings):
|
||||||
|
|
|
||||||
2
lnbits/static/bundle-components.min.js
vendored
2
lnbits/static/bundle-components.min.js
vendored
File diff suppressed because one or more lines are too long
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -319,7 +319,7 @@ window.localisation.en = {
|
||||||
signin_with_nostr: 'Continue with Nostr',
|
signin_with_nostr: 'Continue with Nostr',
|
||||||
signin_with_google: 'Sign in with Google',
|
signin_with_google: 'Sign in with Google',
|
||||||
signin_with_github: 'Sign in with GitHub',
|
signin_with_github: 'Sign in with GitHub',
|
||||||
signin_with_keycloak: 'Sign in with Keycloak',
|
signin_with_custom_org: 'Sign in with {custom_org}',
|
||||||
username_or_email: 'Username or Email',
|
username_or_email: 'Username or Email',
|
||||||
password: 'Password',
|
password: 'Password',
|
||||||
password_config: 'Password Config',
|
password_config: 'Password Config',
|
||||||
|
|
@ -482,6 +482,8 @@ window.localisation.en = {
|
||||||
auth_keycloak_ci_hint:
|
auth_keycloak_ci_hint:
|
||||||
'Make sure thant the authorization callback URL is set to https://{domain}/api/v1/auth/keycloak/token',
|
'Make sure thant the authorization callback URL is set to https://{domain}/api/v1/auth/keycloak/token',
|
||||||
auth_keycloak_cs_label: 'Keycloak Client Secret',
|
auth_keycloak_cs_label: 'Keycloak Client Secret',
|
||||||
|
auth_keycloak_custom_org_label: 'Keycloak Custom Organization',
|
||||||
|
auth_keycloak_custom_icon_label: 'Keycloak Custom Icon (URL)',
|
||||||
currency_settings: 'Currency Settings',
|
currency_settings: 'Currency Settings',
|
||||||
allowed_currencies: 'Allowed Currencies',
|
allowed_currencies: 'Allowed Currencies',
|
||||||
allowed_currencies_hint: 'Limit the number of available fiat currencies',
|
allowed_currencies_hint: 'Limit the number of available fiat currencies',
|
||||||
|
|
|
||||||
|
|
@ -559,7 +559,9 @@ window.app.component('username-password', {
|
||||||
username: this.userName,
|
username: this.userName,
|
||||||
password: this.password_1,
|
password: this.password_1,
|
||||||
passwordRepeat: this.password_2,
|
passwordRepeat: this.password_2,
|
||||||
reset_key: this.resetKey
|
reset_key: this.resetKey,
|
||||||
|
keycloakOrg: LNBITS_AUTH_KEYCLOAK_ORG || 'Keycloak',
|
||||||
|
keycloakIcon: LNBITS_AUTH_KEYCLOAK_ICON
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -1472,10 +1472,22 @@
|
||||||
>
|
>
|
||||||
<q-avatar size="32px" class="q-mr-md">
|
<q-avatar size="32px" class="q-mr-md">
|
||||||
<q-img
|
<q-img
|
||||||
:src="`{{ static_url_for('static', 'images/keycloak-logo.png') }}`"
|
:src="
|
||||||
|
keycloakIcon
|
||||||
|
? keycloakIcon
|
||||||
|
: `{{ static_url_for('static', 'images/keycloak-logo.png') }}`
|
||||||
|
"
|
||||||
></q-img>
|
></q-img>
|
||||||
</q-avatar>
|
</q-avatar>
|
||||||
<div><span v-text="$t('signin_with_keycloak')"></span></div>
|
<div>
|
||||||
|
<span
|
||||||
|
v-text="
|
||||||
|
$t('signin_with_custom_org', {
|
||||||
|
custom_org: keycloakOrg
|
||||||
|
})
|
||||||
|
"
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue