From 2902520f78b22fdf1f6474f34bc669b9549f6473 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Thu, 23 Mar 2023 11:43:27 -0700 Subject: [PATCH 01/10] Enable sourcing local templates from custom directory for upsert commands --- Makefile | 3 ++- README.md | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 33a6ff9..a7e83b1 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ TENANT_ID = your-tenant SERVER_ID = your-workspace-id ISSUER_URL = https://your-tenant.your-region.authz.cloudentity.io/your-tenant/admin THEME_ID = demo +THEME_DIR = theme # # Set TENANT_ID and ISSUER_URL appropriately for your client. # Your client should be in the 'admin' workspace, but SERVER_ID can be any workspace @@ -74,7 +75,7 @@ upsert-template: ## Insert or Update one template (make upsert-template TEMPLATE ${CURL} -D - -X PUT '${BASEURL}/api/admin/${TENANT_ID}/theme/${THEME_ID}/template/${TEMPLATE_PATH}' \ --header 'Authorization: Bearer ${TOKEN}' \ --header 'Content-Type: application/json' \ - --data-binary @<(jq -M --raw-input --slurp < 'theme/${TEMPLATE_PATH}' '{"content":.}') + --data-binary @<(jq -M --raw-input --slurp < '${THEME_DIR}/${TEMPLATE_PATH}' '{"content":.}') delete-template: ## Delete a template (make delete-template TEMPLATE_PATH=pages/authorization/login/scripts.tmpl) ${CURL} -D - -X DELETE '${BASEURL}/api/admin/${TENANT_ID}/theme/${THEME_ID}/template/${TEMPLATE_PATH}' \ diff --git a/README.md b/README.md index c0ea443..45489ee 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ TENANT_ID = your-tenant SERVER_ID = your-workspace-id ISSUER_URL = https://your-tenant.your-region.authz.cloudentity.io/your-tenant/admin THEME_ID = demo +THEME_DIR = theme ``` **IMPORTANT:** When working with a "vanity domain" that does not have a tenant ID in the URL params for API requests, leave the value of the `TENANT_ID` variable blank in the `Makefile.inc`, and set the value of `ISSUER_URL` without the `TENANT_ID` param, as shown below: @@ -54,6 +55,8 @@ ISSUER_URL = https://vanity-domain.your-organization.com/admin > **Note:** `SERVER_ID` refers to the ID of the workspace to which you intend to bind your theme. +The `THEME_DIR` value indicates which directory should be used as the local source of the templates when 'upsert' commands are used. When creating a custom theme, it is possible to leave the default theme unedited as a reference, and set up a custom theme directory with a copy of the whole theme (or containing only a subset of templates to be altered, as long as the directory structure matches that of the default theme). In this case, change the value of `THEME_DIR` to the path of your custom directory. For example, this could be something like `my-custom-themes/demo-theme-1`, where `my-custom-themes` is located in the project root, and with `demo-theme-1` containing the `pages` and `shared` directories, etc. + To test that the makefile is working, you can do `make list-base-templates` to query ACP: ``` $ make list-base-templates From 7bd0fcc2af44d031fe5025926d085f7f5333be2a Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Thu, 23 Mar 2023 11:45:00 -0700 Subject: [PATCH 02/10] Add .gitignore to ignore Makefile.inc --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d59f95f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Makefile.inc From 95ada2cb95f77071283fd5dc32496ce528225623 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Thu, 23 Mar 2023 11:55:26 -0700 Subject: [PATCH 03/10] Fix for upsert-templates command when using custom theme directory --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a7e83b1..2c2f758 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ delete-theme: ## Delete a theme --header 'Authorization: Bearer ${TOKEN}' upsert-templates: ## Insert or Update all templates - for f in $$(cd theme; find * -name '*.tmpl'); \ + for f in $$(cd ${THEME_DIR}; find * -name '*.tmpl'); \ do make upsert-template THEME_ID=${THEME_ID} TEMPLATE_PATH="$$f" TOKEN=${TOKEN} ; \ done From 5c0f475e5b8b22fc2e17f8c8b99b181d95c3d215 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Thu, 23 Mar 2023 14:43:02 -0700 Subject: [PATCH 04/10] Add initial template set for example 'financroo' branded theme --- .../pages/authorization/demo/index.tmpl | 82 + .../pages/authorization/login/index.tmpl | 39 + .../financroo-demo/pages/error/index.tmpl | 39 + .../pages/identity/login/index.tmpl | 31 + .../financroo-demo/shared/base.tmpl | 28 + .../financroo-demo/shared/footer.tmpl | 7 + .../shared/styles_financroo.tmpl | 1522 +++++++++++++++++ 7 files changed, 1748 insertions(+) create mode 100644 custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl create mode 100644 custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl create mode 100644 custom-theme-examples/financroo-demo/pages/error/index.tmpl create mode 100644 custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl create mode 100644 custom-theme-examples/financroo-demo/shared/base.tmpl create mode 100644 custom-theme-examples/financroo-demo/shared/footer.tmpl create mode 100644 custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl diff --git a/custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl b/custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl new file mode 100644 index 0000000..9142307 --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl @@ -0,0 +1,82 @@ +{{ template "base" . }} + +{{ define "title" }}Demo{{ end }} + +{{ define "content" }} + {{ template "demo_scripts" . }} + + {{ if .Data.FlowCompleted }} +
+ {{ template "header" .Styling }} + + + + +
+ +
+
+

Demo Application

+

This is customized

+ +
+
+ error_outline +
+

You have logged in to the Demo app

+

+ The information below is used for demo and testing purposes. + You can view aggregated claims or the tokens issued by ACP below. +

+
+
+
+ +
+ + + + + {{ if .Data.IDTokenRaw }} + + {{ end }} + + {{ if .Data.RefreshTokenRaw }} + + {{ end }} +
+
+
+ +
+ {{ template "demo-claims-tab" . }} + {{ template "demo-access-token-tab" . }} + {{ template "demo-id-token-tab" . }} + {{ template "demo-refresh-token-tab" . }} +
+ + {{ else }} +
+ {{ template "header" .Config }} +
+ +
+ +

Demo {{ .flow }} application

+ + {{ if eq .Data.Flow "device" }} + {{ template "demo-unauthorized" . }} + {{ else }} + {{ template "demo-login" . }} + {{ end }} +
+ {{ end }} +{{ end }} diff --git a/custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl b/custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl new file mode 100644 index 0000000..1cf0a2c --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl @@ -0,0 +1,39 @@ +{{ template "base" . }} + +{{ define "title" }} Login {{ end }} + +{{ define "content" }} + {{ template "login_scripts" . }} + {{ template "password_visibility_script" . }} + +
+ {{ template "header" .Config }} +
+

This is customized

+ + {{ if not .Data.HasIDPs }} + {{ template "login_no_idp" . }} + {{ else }} +
+
+ {{ if .Data.HasAdminTabs }} + {{ template "login_admin_tabs" }} + {{ end }} + +
+
+ {{ template "login_content" . }} +
+
+ + {{ template "login_admin_quick_access" . }} +
+ +
+ Cancel +
+
+ {{ end }} + + {{ template "footer" }} +{{ end }} diff --git a/custom-theme-examples/financroo-demo/pages/error/index.tmpl b/custom-theme-examples/financroo-demo/pages/error/index.tmpl new file mode 100644 index 0000000..bc83180 --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/error/index.tmpl @@ -0,0 +1,39 @@ +{{ template "base" . }} + +{{ define "title" }}Error{{ end }} + +{{ define "content" }} + +
+ {{ template "header" .Config }} +
+

This is customized

+ +
+ + + icon +
{{ .Data.Name }}
+
{{ .Data.Description }}.
+ + {{ if .Data.Hint }} +
{{ .Data.Hint }}
+ {{ end }} + + {{ if .Data.RetryURL }} +
+ Retry + {{ end }} + + {{ if .Data.Version }} +
Version: {{ .Data.Version }}
+ {{ end }} + + {{ if .Data.TraceID }} +
ID: {{ .Data.TraceID }}
+ {{ end }} +
+ +{{ template "footer" }} + +{{ end }} diff --git a/custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl b/custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl new file mode 100644 index 0000000..e15807f --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl @@ -0,0 +1,31 @@ +{{ template "base" . }} + +{{ define "title" }}Login{{ end }} + +{{ define "content" }} + {{ template "identity_login_scripts" . }} + {{ template "password_visibility_script" . }} + +
+ {{ template "header" .Config }} +
+

This is customized

+ +
+
+ + {{ if .Data.AuthnView }} + {{ template "authn" . }} + {{ else }} +
No Authentication Mechanisms Enabled
+ {{ end }} + +
+
+ +
+ Cancel +
+ + {{ template "footer" }} +{{ end }} diff --git a/custom-theme-examples/financroo-demo/shared/base.tmpl b/custom-theme-examples/financroo-demo/shared/base.tmpl new file mode 100644 index 0000000..bbccf91 --- /dev/null +++ b/custom-theme-examples/financroo-demo/shared/base.tmpl @@ -0,0 +1,28 @@ +{{ define "base" }} + + + + + + + + {{ template "title" . }} + + + + + + + + + + {{ template "styles_financroo" . }} + + + + {{ template "content" . }} + + + +{{ end }} diff --git a/custom-theme-examples/financroo-demo/shared/footer.tmpl b/custom-theme-examples/financroo-demo/shared/footer.tmpl new file mode 100644 index 0000000..c2b89d9 --- /dev/null +++ b/custom-theme-examples/financroo-demo/shared/footer.tmpl @@ -0,0 +1,7 @@ +{{ define "footer" }} + +
+
Copyright © {{ now.Year }} Financroo. All Rights Reserved
+
+ +{{ end }} diff --git a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl new file mode 100644 index 0000000..01236f6 --- /dev/null +++ b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl @@ -0,0 +1,1522 @@ +{{ define "styles_financroo" }} + + + +{{ end }} From fb7d24f7c22783574d8de66462c70cf14824fb24 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Fri, 24 Mar 2023 17:07:32 -0700 Subject: [PATCH 05/10] Add basic 'financroo' branding, custom layout on login pages --- .../pages/authorization/demo/index.tmpl | 1 - .../pages/authorization/login/index.tmpl | 64 +++++--- .../login/login_content_mode_idps_list.tmpl | 151 ++++++++++++++++++ .../login/login_content_mode_static_idp.tmpl | 65 ++++++++ .../financroo-demo/pages/error/index.tmpl | 3 +- .../identity/login/authn_mode_password.tmpl | 73 +++++++++ .../pages/identity/login/index.tmpl | 47 +++--- .../financroo-demo/shared/base.tmpl | 2 +- .../financroo-demo/shared/header.tmpl | 7 + .../shared/styles_financroo.tmpl | 141 +++++++++++++--- 10 files changed, 488 insertions(+), 66 deletions(-) create mode 100644 custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_idps_list.tmpl create mode 100644 custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_static_idp.tmpl create mode 100644 custom-theme-examples/financroo-demo/pages/identity/login/authn_mode_password.tmpl create mode 100644 custom-theme-examples/financroo-demo/shared/header.tmpl diff --git a/custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl b/custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl index 9142307..7e1a546 100644 --- a/custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl +++ b/custom-theme-examples/financroo-demo/pages/authorization/demo/index.tmpl @@ -17,7 +17,6 @@

Demo Application

-

This is customized

diff --git a/custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl b/custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl index 1cf0a2c..017a395 100644 --- a/custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl +++ b/custom-theme-examples/financroo-demo/pages/authorization/login/index.tmpl @@ -6,34 +6,48 @@ {{ template "login_scripts" . }} {{ template "password_visibility_script" . }} -
- {{ template "header" .Config }} -
-

This is customized

- - {{ if not .Data.HasIDPs }} - {{ template "login_no_idp" . }} - {{ else }} -
-
- {{ if .Data.HasAdminTabs }} - {{ template "login_admin_tabs" }} - {{ end }} - -
-
- {{ template "login_content" . }} +
+
+
+
+
+ +
+
+
+ {{ template "header" .Config }}
-
- {{ template "login_admin_quick_access" . }} -
+
+ {{ if not .Data.HasIDPs }} + {{ template "login_no_idp" . }} + {{ else }} +
+
+ {{ if .Data.HasAdminTabs }} + {{ template "login_admin_tabs" }} + {{ end }} + +
+
+ {{ template "login_content" . }} +
+
+ + {{ template "login_admin_quick_access" . }} +
+ +
+ Cancel +
+
+ {{ end }} +
+ + {{ template "footer" }} -
- Cancel +
- {{ end }} - - {{ template "footer" }} +
{{ end }} diff --git a/custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_idps_list.tmpl b/custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_idps_list.tmpl new file mode 100644 index 0000000..1da9afe --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_idps_list.tmpl @@ -0,0 +1,151 @@ +{{ define "login_content_mode_idps_list" }} + +
+ + +
+ error_outline + Failed to fetch IDPs +
+ +
+ error_outline + Authentication is not supported for this user/domain +
+ + {{ if .Data.RememberedSignInMethod }} + {{ template "login_content_remembered_idp" . }} + {{ else }} + {{ if .Data.IDPDiscoveryEnabled }} +

Sign into your account

+
+ {{ .Data.CsrfField }} + +
+ + +
+ + +
+ + {{ else }} +

Select how you want to sign in

+ + + {{ end }} + {{ end }} + +
+ {{ if or .Data.RememberedSignInMethod .Data.IDPDiscoveryEnabled }} +
Sign in with
+ {{ end }} +
+ +
+ {{ range $method := .Data.Methods }} + + {{ end }} +
+ +
+ +
+ + {{ if .Data.IDPDiscoveryEnabled }} + + {{ end }} + +
+ +{{ end }} diff --git a/custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_static_idp.tmpl b/custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_static_idp.tmpl new file mode 100644 index 0000000..9346376 --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/authorization/login/login_content_mode_static_idp.tmpl @@ -0,0 +1,65 @@ +{{ define "login_content_mode_static_idp" }} + +
+ + + + + {{ range .Data.FormError.Errors }} +
+
+ error_outline + {{ .Message }} +
+
+ {{ end }} + + {{ if gt (len .Data.Methods) 1 }} + + {{ end }} + +

Sign into your account

+ +
+ {{ .Data.CsrfField }} + + {{ if and .Data.IDP.SettingsHint (gt (len .Data.IDP.Credentials.Users) 0) }} +
+

This is a mock IDP login page.

+
+
Username: {{ (index .Data.IDP.Credentials.Users 0).Username }}
+
Password: {{ (index .Data.IDP.Credentials.Users 0).Password }}
+
+
+ {{ end }} + +
+ + +
+ +
+ +
+ + +
+
+ + + + +
+ +
+ +{{ end }} diff --git a/custom-theme-examples/financroo-demo/pages/error/index.tmpl b/custom-theme-examples/financroo-demo/pages/error/index.tmpl index bc83180..e5685ab 100644 --- a/custom-theme-examples/financroo-demo/pages/error/index.tmpl +++ b/custom-theme-examples/financroo-demo/pages/error/index.tmpl @@ -7,12 +7,11 @@
{{ template "header" .Config }}
-

This is customized

- icon +
{{ .Data.Name }}
{{ .Data.Description }}.
diff --git a/custom-theme-examples/financroo-demo/pages/identity/login/authn_mode_password.tmpl b/custom-theme-examples/financroo-demo/pages/identity/login/authn_mode_password.tmpl new file mode 100644 index 0000000..b7b5fc2 --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/identity/login/authn_mode_password.tmpl @@ -0,0 +1,73 @@ +{{ define "authn_password" }} + +

Sign into your account

+ +
+ + +
+ +
+ + +
+ + +
+
+ + + + {{ if .Data.AuthnModeSwitch }} + +
+ + +
+
or sign in with
+
+ +
+ + {{ if .Data.AuthenticationMechanismsAvailability.otp }} + + {{ end }} + + {{ if .Data.AuthenticationMechanismsAvailability.webauthn }} + + {{ end }} + +
+
+ {{ end }} + + + + +{{ end }} diff --git a/custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl b/custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl index e15807f..6687b22 100644 --- a/custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl +++ b/custom-theme-examples/financroo-demo/pages/identity/login/index.tmpl @@ -6,26 +6,35 @@ {{ template "identity_login_scripts" . }} {{ template "password_visibility_script" . }} -
- {{ template "header" .Config }} -
-

This is customized

- -
-
- - {{ if .Data.AuthnView }} - {{ template "authn" . }} - {{ else }} -
No Authentication Mechanisms Enabled
- {{ end }} - +
+
+
+
+
+ +
+
+
+ {{ template "header" .Config }} +
+ +
+
+ + {{ if .Data.AuthnView }} + {{ template "authn" . }} + {{ else }} +
No Authentication Mechanisms Enabled
+ {{ end }} + +
+
+ + {{ template "footer" }} + +
+
-
- Cancel -
- - {{ template "footer" }} {{ end }} diff --git a/custom-theme-examples/financroo-demo/shared/base.tmpl b/custom-theme-examples/financroo-demo/shared/base.tmpl index bbccf91..d21cddc 100644 --- a/custom-theme-examples/financroo-demo/shared/base.tmpl +++ b/custom-theme-examples/financroo-demo/shared/base.tmpl @@ -5,7 +5,7 @@ - + {{ template "title" . }} diff --git a/custom-theme-examples/financroo-demo/shared/header.tmpl b/custom-theme-examples/financroo-demo/shared/header.tmpl new file mode 100644 index 0000000..c729f7a --- /dev/null +++ b/custom-theme-examples/financroo-demo/shared/header.tmpl @@ -0,0 +1,7 @@ +{{ define "header" }} + + + +{{ end }} diff --git a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl index 01236f6..c14ce8b 100644 --- a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl +++ b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl @@ -13,14 +13,15 @@ } :root { - --mdc-theme-primary: #0083ff; + /* --mdc-theme-primary: #0083ff; */ + --mdc-theme-primary: #1f2d48; --mdc-theme-secondary: #0083ff; --mdc-theme-background: #f7faff; --header: #434656; } body { - background-color: var(--mdc-theme-background); + /* background-color: var(--mdc-theme-background); */ margin: 0; } @@ -56,10 +57,12 @@ } .aut-banner-logo img { - height: 24px; - width: auto; - max-width: 350px; - object-fit: contain; + /* height: 24px; */ + /* width: auto; */ + /* max-width: 350px; */ + /* object-fit: contain; */ + margin-top: 25px; + margin-bottom: 44px; } .demo-info { @@ -239,7 +242,7 @@ #cancel { font-size: 12px; font-weight: 600; - margin-left: 32px; + /* margin-left: 32px; */ line-height: 24px; } @@ -298,8 +301,8 @@ align-items: center; justify-content: center; text-transform: uppercase; - height: 66px; - background: var(--header); + /* height: 66px; */ + /* background: var(--header); */ position: relative; } @@ -309,11 +312,12 @@ } .card { - max-width: 480px; + /* max-width: 480px; */ + max-width: 600px; margin: 80px auto 20px auto; margin-bottom: 20px; - border: solid 1px rgb(0, 0, 0, 0.1); - background-color: white; + /* border: solid 1px rgb(0, 0, 0, 0.1); */ + /* background-color: white; */ } .color-bar { @@ -349,14 +353,18 @@ } .content { - padding: 32px; + /* padding: 32px; */ } .content h2 { - font-weight: normal; - font-size: 28px; + /* font-weight: normal; */ + font-weight: 600; + color: #626576; + /* font-size: 28px; */ + font-size: 18px; line-height: 40px; - margin: 0 0 27px; + /* margin: 0 0 27px; */ + margin: 0 0 14px; } .content input { @@ -921,8 +929,10 @@ } .cancel-container { - max-width: 480px; - margin: 0 auto; + /* max-width: 480px; */ + max-width: 600px; + /* margin: 0 auto; */ + margin-top: 25px; } .quick-access-content { @@ -1517,6 +1527,101 @@ .small-icon { width: 24px; } + + /* Styles for custom classes */ + .content-wrapper { + height: 100vh; + } + + .content-flex { + box-sizing: border-box; + display: flex; + flex-flow: row wrap; + width: 100%; + } + + .content-background { + width: 100%; + height: 100%; + background-image: url('https://financroo-demo.s3.us-west-2.amazonaws.com/background-login.png'); + background-repeat: no-repeat; + background-position: center center; + background-size: cover; + } + + .content-left { + box-sizing: border-box; + margin: 0px; + flex-direction: row; + } + + .content-right { + box-sizing: border-box; + margin: 0px; + flex-direction: row; + flex-basis: 100%; + -webkit-box-flex: 0; + flex-grow: 0; + max-width: 100%; + } + + @media (min-width: 1280px) { + .content-left { + flex-basis: 58.3333%; + -webkit-box-flex: 0; + flex-grow: 0; + max-width: 58.3333%; + } + + .content-right { + flex-basis: 41.6667%; + -webkit-box-flex: 0; + flex-grow: 0; + max-width: 41.6667%; + } + } + + @media (min-width: 480px) { + .content-left { + flex-basis: 50%; + -webkit-box-flex: 0; + flex-grow: 0; + max-width: 50%; + } + + .content-right { + flex-basis: 50%; + -webkit-box-flex: 0; + flex-grow: 0; + max-width: 50%; + } + } + + .card-right { + width: 100%; + } + + @media (min-width: 1280px) { + .card-right { + width: 500px; + } + } + + .aut-content-wrapper { + height: calc(100vh - 90px); + display: flex; + flex-direction: column; + align-items: flex-start; + -webkit-box-pack: center; + justify-content: center; + padding: 45px; + } + + @media (min-width: 1280px) { + .aut-content-wrapper { + padding: 45px 80px; + } + } {{ end }} From daa8322ab326e6503ddcaa65a87035d78ac58759 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Mon, 27 Mar 2023 10:57:49 -0700 Subject: [PATCH 06/10] Styling refinements --- .../financroo-demo/pages/error/index.tmpl | 6 ++- .../shared/styles_financroo.tmpl | 39 ++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/custom-theme-examples/financroo-demo/pages/error/index.tmpl b/custom-theme-examples/financroo-demo/pages/error/index.tmpl index e5685ab..828fd5b 100644 --- a/custom-theme-examples/financroo-demo/pages/error/index.tmpl +++ b/custom-theme-examples/financroo-demo/pages/error/index.tmpl @@ -13,7 +13,11 @@
{{ .Data.Name }}
-
{{ .Data.Description }}.
+ +
+ error_outline + {{ .Data.Description }}. +
{{ if .Data.Hint }}
{{ .Data.Hint }}
diff --git a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl index c14ce8b..56e9a76 100644 --- a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl +++ b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl @@ -102,7 +102,7 @@ margin-bottom: 12px; font-size: 28px; line-height: 40px; - color: #626576; + color: #cf3228; } #error-description { @@ -259,7 +259,7 @@ font-size: 12px; justify-content: center; color: #626576; - margin: 80px 0 32px 0; + margin: 50px 0 32px 0; width: 100%; line-height: 24px; } @@ -314,16 +314,16 @@ .card { /* max-width: 480px; */ max-width: 600px; - margin: 80px auto 20px auto; + margin: 40px auto 20px auto; margin-bottom: 20px; /* border: solid 1px rgb(0, 0, 0, 0.1); */ /* background-color: white; */ } .color-bar { - height: 8px; - background-color: var(--mdc-theme-primary); - border-radius: 4px 4px 0 0; + /* height: 8px; */ + /* background-color: var(--mdc-theme-primary); */ + /* border-radius: 4px 4px 0 0; */ } .header { @@ -771,8 +771,9 @@ } .consent-header { - border-bottom: solid 1px rgba(0, 0, 0, 0.1); - border-radius: 0; + /* border-bottom: solid 1px rgba(0, 0, 0, 0.1); */ + /* border-radius: 0; */ + margin-bottom: 20px; } .consent-footer { @@ -1565,35 +1566,35 @@ max-width: 100%; } - @media (min-width: 1280px) { + @media (min-width: 480px) { .content-left { - flex-basis: 58.3333%; + flex-basis: 50%; -webkit-box-flex: 0; flex-grow: 0; - max-width: 58.3333%; + max-width: 50%; } .content-right { - flex-basis: 41.6667%; + flex-basis: 50%; -webkit-box-flex: 0; flex-grow: 0; - max-width: 41.6667%; + max-width: 50%; } } - @media (min-width: 480px) { + @media (min-width: 1280px) { .content-left { - flex-basis: 50%; + flex-basis: 58.3333%; -webkit-box-flex: 0; flex-grow: 0; - max-width: 50%; + max-width: 58.3333%; } .content-right { - flex-basis: 50%; + flex-basis: 41.6667%; -webkit-box-flex: 0; flex-grow: 0; - max-width: 50%; + max-width: 41.6667%; } } @@ -1601,7 +1602,7 @@ width: 100%; } - @media (min-width: 1280px) { + @media (min-width: 1580px) { .card-right { width: 500px; } From f7e1ff2661c0ac2babfa3133fe6c2a4f19ac1aba Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Mon, 27 Mar 2023 11:44:54 -0700 Subject: [PATCH 07/10] Styling refinements for card element on mobile view --- .../financroo-demo/shared/styles_financroo.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl index 56e9a76..10f74d7 100644 --- a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl +++ b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl @@ -1602,9 +1602,9 @@ width: 100%; } - @media (min-width: 1580px) { - .card-right { - width: 500px; + @media (max-width: 650px) { + .card { + margin: 15px 20px 20px 20px; } } From 50357a4be2f30b36961e40a22457aeb7ff9f36e9 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Mon, 27 Mar 2023 12:11:11 -0700 Subject: [PATCH 08/10] Docs improvements --- Makefile | 2 +- README.md | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2c2f758..8946a7f 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,8 @@ CLIENT_ID = PUT_YOUR_CLIENT_ID_HERE CLIENT_SECRET = PUT_YOUR_CLIENT_SECRET_HERE TENANT_ID = your-tenant -SERVER_ID = your-workspace-id ISSUER_URL = https://your-tenant.your-region.authz.cloudentity.io/your-tenant/admin +SERVER_ID = your-workspace-id THEME_ID = demo THEME_DIR = theme # diff --git a/README.md b/README.md index 45489ee..9fb2a49 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,12 @@ If a situation comes up in which it's absolutely necessary for someone to make a ## How to use the Makefile/CLI +Prerequisites: +- `jq` - A command line [JSON processor](https://github.com/stedolan/jq). + You will need to create an ACP Client named 'manage-themes' in the Admin workspace with the application type `Service`. -> Note: If the `Service` application type is not available, in the Admin workspace, navigate to "Auth Setttings > OAuth," and under "Allowed Grant types," make sure "Client credentials" is selected. +> **Note:** If the `Service` application type is not available, in the Admin workspace, navigate to "Auth Settings > OAuth," and under "Allowed Grant types," make sure "Client credentials" is selected. Confirm these OAuth settings after you have created the client: @@ -40,12 +43,14 @@ Now create a file named `Makefile.inc` that overrides the following default valu CLIENT_ID = PUT_YOUR_CLIENT_ID_HERE CLIENT_SECRET = PUT_YOUR_CLIENT_SECRET_HERE TENANT_ID = your-tenant -SERVER_ID = your-workspace-id ISSUER_URL = https://your-tenant.your-region.authz.cloudentity.io/your-tenant/admin +SERVER_ID = your-workspace-id THEME_ID = demo THEME_DIR = theme ``` +> **Note:** The `ISSUER_URL` is related to the OAuth client in the Admin workspace, thus the path pattern is `your-tenant/admin`. The `SERVER_ID` refers to the ID of the **workspace** to which the theme is to be bound. **NEVER** put `admin` as the value for `SERVER_ID`, as using a custom theme that is bound to the admin workspace has the potential to lock you out of your tenant if you make an edit in the custom theme templates that results in certain types of errors. Always use a dedicated test workspace for actively developing the theme. + **IMPORTANT:** When working with a "vanity domain" that does not have a tenant ID in the URL params for API requests, leave the value of the `TENANT_ID` variable blank in the `Makefile.inc`, and set the value of `ISSUER_URL` without the `TENANT_ID` param, as shown below: ``` From 9a8d0923340dce4e4eb6288870bc63421338c057 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Tue, 28 Mar 2023 18:12:35 -0700 Subject: [PATCH 09/10] Fix styles for long page content on mobile devices --- .../financroo-demo/shared/styles_financroo.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl index 10f74d7..9a871f7 100644 --- a/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl +++ b/custom-theme-examples/financroo-demo/shared/styles_financroo.tmpl @@ -1609,18 +1609,18 @@ } .aut-content-wrapper { - height: calc(100vh - 90px); + height: 100%; display: flex; flex-direction: column; align-items: flex-start; -webkit-box-pack: center; justify-content: center; - padding: 45px; + padding: 0 45px; } @media (min-width: 1280px) { .aut-content-wrapper { - padding: 45px 80px; + padding: 0 80px; } } From d6fc8a7b687fff6305b2a740bed36b428a37fa31 Mon Sep 17 00:00:00 2001 From: Caleb Sattgast Date: Wed, 29 Mar 2023 12:12:08 -0700 Subject: [PATCH 10/10] Add customized self-register page --- .../pages/identity/register/index.tmpl | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 custom-theme-examples/financroo-demo/pages/identity/register/index.tmpl diff --git a/custom-theme-examples/financroo-demo/pages/identity/register/index.tmpl b/custom-theme-examples/financroo-demo/pages/identity/register/index.tmpl new file mode 100644 index 0000000..dcd08bd --- /dev/null +++ b/custom-theme-examples/financroo-demo/pages/identity/register/index.tmpl @@ -0,0 +1,47 @@ +{{ template "base" . }} + +{{ define "title" }}Register{{ end }} + +{{ define "content" }} + +
+
+
+
+
+ +
+
+ +
+ {{ template "header" .Config }} +
+ + {{ template "identity_register_scripts" . }} + {{ template "password_visibility_script" . }} + {{ template "submit_button_disabling_script" . }} + +
+
+

Sign up for a new account

+ + {{ template "form" . }} + + {{ range .Data.FormError.Errors }} + {{ template "error_message" . }} + {{ end }} + + +
+
+ + {{ template "footer" }} + +
+
+
+
+ +{{ end }}