Skip to content

Commit 2781f44

Browse files
committed
first
1 parent 5f7de94 commit 2781f44

File tree

2 files changed

+40
-1
lines changed
  • src/frontend

2 files changed

+40
-1
lines changed

src/frontend/src/routes/(new-styling)/(resuming-channel)/resume-openid-authorize/+page.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
const implicitConsentAttributeKeys = paramsResult.data.attributes.filter(
5454
(attribute) =>
5555
attribute === `openid:${issuer}:name` ||
56-
attribute === `openid:${issuer}:email`,
56+
attribute === `openid:${issuer}:email` ||
57+
attribute === `openid:${issuer}:verified_email`,
5758
);
5859
try {
5960
const { attributes, issued_at_timestamp_ns } =

src/frontend/tests/e2e-playwright/authorize/openid.spec.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,42 @@ test.describe("Authorize with direct OpenID", () => {
143143
await signInWithOpenId(authorizePage.page, openIdUsers[0].id);
144144
});
145145
});
146+
147+
test.describe("with verified_email attribute", () => {
148+
const email = "john.doe@example.com";
149+
150+
test.use({
151+
openIdConfig: {
152+
defaultPort: DEFAULT_OPENID_PORT,
153+
createUsers: [
154+
{
155+
claims: { email, email_verified: "true" },
156+
},
157+
],
158+
},
159+
authorizeConfig: {
160+
protocol: "icrc25",
161+
openid: `http://localhost:${DEFAULT_OPENID_PORT}`,
162+
attributes: [
163+
`openid:http://localhost:${DEFAULT_OPENID_PORT}:verified_email`,
164+
],
165+
},
166+
});
167+
168+
test.afterEach(({ authorizedPrincipal, authorizedAttributes }) => {
169+
expect(authorizedPrincipal?.isAnonymous()).toBe(false);
170+
expect(authorizedAttributes).toEqual({
171+
[`openid:http://localhost:${DEFAULT_OPENID_PORT}:verified_email`]:
172+
email,
173+
});
174+
});
175+
176+
test("should return verified email", async ({
177+
authorizePage,
178+
signInWithOpenId,
179+
openIdUsers,
180+
}) => {
181+
await signInWithOpenId(authorizePage.page, openIdUsers[0].id);
182+
});
183+
});
146184
});

0 commit comments

Comments
 (0)