From bfb00701d6919a9208cdeeffda61a2b4b8b582f6 Mon Sep 17 00:00:00 2001 From: Venkata Saidurga Polamraju Date: Tue, 8 Aug 2023 16:53:15 +0530 Subject: [PATCH] [ES-223] --- sign-in-with-esignet/examples/html-example/index.html | 2 ++ .../src/lib/SignInWithEsignet/ISignInWithEsignetProps.ts | 2 ++ .../src/lib/SignInWithEsignet/SignInWithEsignet.ts | 6 ++++++ .../src/stories/SignInWithEsignet.stories.ts | 2 ++ storybook-example/stories/SignInWithEsignet.stories.ts | 4 +++- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sign-in-with-esignet/examples/html-example/index.html b/sign-in-with-esignet/examples/html-example/index.html index b99df23..6835d77 100644 --- a/sign-in-with-esignet/examples/html-example/index.html +++ b/sign-in-with-esignet/examples/html-example/index.html @@ -25,6 +25,8 @@ prompt: "consent", max_age: 21, ui_locales: "en", + code_challenge: "", + code_challenge_method: "S256", }; window.onload = function () { diff --git a/sign-in-with-esignet/src/lib/SignInWithEsignet/ISignInWithEsignetProps.ts b/sign-in-with-esignet/src/lib/SignInWithEsignet/ISignInWithEsignetProps.ts index ef7e10c..f915be0 100644 --- a/sign-in-with-esignet/src/lib/SignInWithEsignet/ISignInWithEsignetProps.ts +++ b/sign-in-with-esignet/src/lib/SignInWithEsignet/ISignInWithEsignetProps.ts @@ -10,6 +10,8 @@ interface OidcConfigProp { claims?: object; claims_locales?: string; ui_locales?: string; + code_challenge?: string; + code_challenge_method?: string; display?: string; max_age?: number; prompt?: string; diff --git a/sign-in-with-esignet/src/lib/SignInWithEsignet/SignInWithEsignet.ts b/sign-in-with-esignet/src/lib/SignInWithEsignet/SignInWithEsignet.ts index 064ebaa..1d0a522 100644 --- a/sign-in-with-esignet/src/lib/SignInWithEsignet/SignInWithEsignet.ts +++ b/sign-in-with-esignet/src/lib/SignInWithEsignet/SignInWithEsignet.ts @@ -96,6 +96,12 @@ function buildRedirectURL(oidcConfig: OidcConfigProp): string { if (oidcConfig?.ui_locales) urlToNavigate += "&ui_locales=" + oidcConfig.ui_locales; + if (oidcConfig?.code_challenge) + urlToNavigate += "&code_challenge=" + oidcConfig.code_challenge; + + if (oidcConfig?.code_challenge_method) + urlToNavigate += "&code_challenge_method=" + oidcConfig.code_challenge_method; + return urlToNavigate; } diff --git a/sign-in-with-esignet/src/stories/SignInWithEsignet.stories.ts b/sign-in-with-esignet/src/stories/SignInWithEsignet.stories.ts index c814bc4..c8e9510 100644 --- a/sign-in-with-esignet/src/stories/SignInWithEsignet.stories.ts +++ b/sign-in-with-esignet/src/stories/SignInWithEsignet.stories.ts @@ -56,6 +56,8 @@ export const SignInWithEsignetStory: Story = { prompt: "consent", max_age: 21, ui_locales: "en", + code_challenge: "", + code_challenge_method: "S256", }, buttonConfig: { type: "standard", diff --git a/storybook-example/stories/SignInWithEsignet.stories.ts b/storybook-example/stories/SignInWithEsignet.stories.ts index 525919e..228e754 100644 --- a/storybook-example/stories/SignInWithEsignet.stories.ts +++ b/storybook-example/stories/SignInWithEsignet.stories.ts @@ -16,6 +16,8 @@ const oidcConfig = { prompt: "consent", max_age: 21, ui_locales: "en", + code_challenge: "", + code_challenge_method: "S256", }; const buttonConfig = { @@ -26,7 +28,7 @@ const buttonConfig = { }; const oidcConfigType = - '{\r\n authorizeUri: "string",\r\n redirect_uri: "string",\r\n client_id: "string",\r\n scope: "string",\r\n nonce: "string",\r\n state: "string",\r\n acr_values: "string",\r\n claims_locales: "string",\r\n ui_locales: "string",\r\n display: "page" | "popup" | "touch" | "wap",\r\n max_age: "number",\r\n prompt: "none" | "login" | "consent" | "select_account",\r\n}'; + '{\r\n authorizeUri: "string",\r\n redirect_uri: "string",\r\n client_id: "string",\r\n scope: "string",\r\n nonce: "string",\r\n state: "string",\r\n acr_values: "string",\r\n claims_locales: "string",\r\n ui_locales: "string",\r\n code_challenge: "string",\r\n code_challenge_method: "string",\r\n display: "page" | "popup" | "touch" | "wap",\r\n max_age: "number",\r\n prompt: "none" | "login" | "consent" | "select_account",\r\n}'; const buttonType = '{\r\n type: "standard" | "icon",\r\n theme: "outline" | "filled_orange" | "filled_black" | "custom",\r\n shape: "sharp_edges" | "soft_edges" | "rounded_edges",\r\n labelText: "string",\r\n logoPath: "string",\r\n width: "string",\r\n background: "string",\r\n textColor: "string",\r\n borderColor: "string",\r\n borderWidth: "string",\r\n font: "string",\r\n fontFamily: "string",\r\n customStyle: "Json-Object",\r\n}';