Skip to content

Commit 2c0abbe

Browse files
Merge pull request #67 from ShippingBytes/fix/guide-user-to-device-auth
2 parents 04a666a + 3796f7e commit 2c0abbe

15 files changed

Lines changed: 5089 additions & 3853 deletions

File tree

.markdownlint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"MD013": {
66
"line_length": 180
77
}
8-
}
8+
}

apps/login-test-acceptance/docker-compose-ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
services:
2-
32
zitadel:
43
environment:
54
ZITADEL_EXTERNALDOMAIN: traefik

apps/login-test-acceptance/docker-compose.yaml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
services:
2-
32
zitadel:
43
user: "${UID:-1000}:${GID:-1000}"
54
image: "${ZITADEL_TAG:-ghcr.io/zitadel/zitadel:latest}"
@@ -9,7 +8,7 @@ services:
98
- "traefik.enable=true"
109
- "traefik.http.routers.zitadel.rule=!PathPrefix(`/ui/v2/login`)"
1110
# - "traefik.http.middlewares.zitadel.headers.customrequestheaders.Host=localhost"
12-
# - "traefik.http.routers.zitadel.middlewares=zitadel@docker"
11+
# - "traefik.http.routers.zitadel.middlewares=zitadel@docker"
1312
- "traefik.http.services.zitadel-service.loadbalancer.server.scheme=h2c"
1413
ports:
1514
- "8080:8080"
@@ -54,7 +53,7 @@ services:
5453
- "traefik.http.routers.login.rule=PathPrefix(`/ui/v2/login`)"
5554
- "traefik.http.services.login-service.loadbalancer.server.url=http://host.docker.internal:3000"
5655
command:
57-
# - "--log.level=DEBUG"
56+
# - "--log.level=DEBUG"
5857
- "--ping"
5958
- "--api.insecure=true"
6059
- "--providers.docker=true"
@@ -113,16 +112,16 @@ services:
113112
args:
114113
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
115114
environment:
116-
PORT: '3333'
115+
PORT: "3333"
117116
command:
118117
- -port
119-
- '3333'
118+
- "3333"
120119
- -email
121-
- '/email'
120+
- "/email"
122121
- -sms
123-
- '/sms'
122+
- "/sms"
124123
- -notification
125-
- '/notification'
124+
- "/notification"
126125
ports:
127126
- "3333:3333"
128127
depends_on:
@@ -139,14 +138,14 @@ services:
139138
args:
140139
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
141140
environment:
142-
API_URL: 'http://traefik'
143-
API_DOMAIN: 'traefik'
144-
PAT_FILE: '/pat/zitadel-admin-sa.pat'
145-
LOGIN_URL: 'https://traefik/ui/v2/login'
146-
ISSUER: 'https://traefik'
147-
HOST: 'traefik'
148-
PORT: '8000'
149-
SCOPES: 'openid profile email'
141+
API_URL: "http://traefik"
142+
API_DOMAIN: "traefik"
143+
PAT_FILE: "/pat/zitadel-admin-sa.pat"
144+
LOGIN_URL: "https://traefik/ui/v2/login"
145+
ISSUER: "https://traefik"
146+
HOST: "traefik"
147+
PORT: "8000"
148+
SCOPES: "openid profile email"
150149
ports:
151150
- "8000:8000"
152151
volumes:
@@ -167,11 +166,11 @@ services:
167166
args:
168167
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
169168
environment:
170-
API_URL: 'http://traefik'
171-
API_DOMAIN: 'traefik'
172-
PAT_FILE: '/pat/zitadel-admin-sa.pat'
173-
SCHEMA: 'https'
174-
HOST: 'traefik'
169+
API_URL: "http://traefik"
170+
API_DOMAIN: "traefik"
171+
PAT_FILE: "/pat/zitadel-admin-sa.pat"
172+
SCHEMA: "https"
173+
HOST: "traefik"
175174
PORT: "8004"
176175
ports:
177176
- 8004:8004
@@ -193,13 +192,13 @@ services:
193192
args:
194193
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
195194
environment:
196-
API_URL: 'http://traefik'
197-
API_DOMAIN: 'traefik'
198-
PAT_FILE: '/pat/zitadel-admin-sa.pat'
199-
LOGIN_URL: 'https://traefik/ui/v2/login'
200-
IDP_URL: 'http://zitadel:8080/saml/v2/metadata'
201-
HOST: 'https://traefik'
202-
PORT: '8001'
195+
API_URL: "http://traefik"
196+
API_DOMAIN: "traefik"
197+
PAT_FILE: "/pat/zitadel-admin-sa.pat"
198+
LOGIN_URL: "https://traefik/ui/v2/login"
199+
IDP_URL: "http://zitadel:8080/saml/v2/metadata"
200+
HOST: "https://traefik"
201+
PORT: "8001"
203202
ports:
204203
- 8001:8001
205204
volumes:
@@ -220,11 +219,11 @@ services:
220219
args:
221220
- LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
222221
environment:
223-
API_URL: 'http://traefik:8080'
224-
API_DOMAIN: 'traefik'
225-
PAT_FILE: '/pat/zitadel-admin-sa.pat'
226-
SCHEMA: 'https'
227-
HOST: 'traefik'
222+
API_URL: "http://traefik:8080"
223+
API_DOMAIN: "traefik"
224+
PAT_FILE: "/pat/zitadel-admin-sa.pat"
225+
SCHEMA: "https"
226+
HOST: "traefik"
228227
PORT: "8003"
229228
ports:
230229
- 8003:8003

apps/login/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"loginname": {
2323
"title": "Welcome",
2424
"description": "Choose your login method:",
25+
"deviceAuthNotice": "Sign in to authorize the device and complete the connection.",
2526
"register": "Create account",
2627
"submit": "Continue",
2728
"notRegistered": "Not registered?",
@@ -266,7 +267,8 @@
266267
"title": "{appName} would like to connect",
267268
"description": "{appName} will have access to:",
268269
"disclaimer": "By clicking Allow, you allow {appName} and Zitadel to use your information in accordance with their respective terms of service and privacy policies. You can revoke this access at any time.",
269-
"submit": "Allow",
270+
"signInNotice": "You'll need to sign in to complete the authorization.",
271+
"submit": "Allow & Sign In",
270272
"deny": "Deny"
271273
},
272274
"scope": {

apps/login/src/app/(main)/(boxed)/signedin/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Alert, AlertType } from "@/components/alert";
22
import { Button, ButtonVariants } from "@/components/button";
3-
43
import { Translated } from "@/components/translated";
54
import { UserAvatar } from "@/components/user-avatar";
65
import {
@@ -59,7 +58,9 @@ export default async function Page(props: { searchParams: Promise<any> }) {
5958
});
6059
} catch (err) {
6160
deviceAuthorizationError =
62-
err instanceof Error ? err.message : "Could not complete device authorization";
61+
err instanceof Error
62+
? err.message
63+
: "Could not complete device authorization";
6364
}
6465
}
6566

apps/login/src/app/(main)/(illustration)/loginname/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Alert, AlertType } from "@/components/alert";
12
import { SignInWithIdp } from "@/components/sign-in-with-idp";
23
import { Translated } from "@/components/translated";
34
import { UsernameForm } from "@/components/username-form";
@@ -59,6 +60,8 @@ export default async function Page(props: {
5960

6061
const lastUsedIdpId = await getLastUsedIdpId();
6162

63+
const isDeviceAuth = requestId?.startsWith("device_");
64+
6265
return (
6366
<>
6467
<h1>
@@ -68,6 +71,12 @@ export default async function Page(props: {
6871
<Translated i18nKey="description" namespace="loginname" />
6972
</p>
7073

74+
{isDeviceAuth && (
75+
<Alert type={AlertType.INFO}>
76+
<Translated i18nKey="deviceAuthNotice" namespace="loginname" />
77+
</Alert>
78+
)}
79+
7180
{loginSettings?.allowUsernamePassword && (
7281
<>
7382
<UsernameForm

apps/login/src/components/consent.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export function ConsentScreen({
8181
/>
8282
</p>
8383

84+
<p className="ztdl-p text-xs text-left font-medium">
85+
<Translated i18nKey="request.signInNotice" namespace="device" />
86+
</p>
87+
8488
{error && (
8589
<div className="py-4">
8690
<Alert>{error}</Alert>

config/base/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ spec:
6969
scheme: HTTP
7070
dnsPolicy: ClusterFirst
7171
restartPolicy: Always
72-
terminationGracePeriodSeconds: 30
72+
terminationGracePeriodSeconds: 30

config/base/http-route.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ spec:
1616
backendRefs:
1717
- name: auth-ui
1818
kind: Service
19-
group: ''
20-
port: 3000
19+
group: ""
20+
port: 3000

config/base/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
resources:
22
- deployment.yaml
33
- service.yaml
4-
- http-route.yaml
4+
- http-route.yaml

0 commit comments

Comments
 (0)