From f23146520e24860b7ccafbc9b8a415d19092cf5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 17 Jan 2023 11:26:41 +0100 Subject: [PATCH] Use the supplied token in the Custom User sign in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/rich-fireants-happen.md | 5 +++++ .../core-components/src/layout/SignInPage/customProvider.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/rich-fireants-happen.md diff --git a/.changeset/rich-fireants-happen.md b/.changeset/rich-fireants-happen.md new file mode 100644 index 0000000000..9b51d05c4f --- /dev/null +++ b/.changeset/rich-fireants-happen.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Ensure that the "Custom User" sign-in makes use of supplied custom tokens, if any diff --git a/packages/core-components/src/layout/SignInPage/customProvider.tsx b/packages/core-components/src/layout/SignInPage/customProvider.tsx index 13ba906079..101c74d3cd 100644 --- a/packages/core-components/src/layout/SignInPage/customProvider.tsx +++ b/packages/core-components/src/layout/SignInPage/customProvider.tsx @@ -69,10 +69,11 @@ const Component: ProviderComponent = ({ onSignInSuccess }) => { const { errors } = formState; - const handleResult = ({ userId }: Data) => { + const handleResult = ({ userId, idToken }: Data) => { onSignInSuccess( UserIdentity.fromLegacy({ userId, + getIdToken: idToken !== undefined ? async () => idToken : undefined, profile: { email: `${userId}@example.com`, },