From a4ebd513527c7c4f0674196eed680a01b2409afe Mon Sep 17 00:00:00 2001 From: drodil Date: Thu, 16 Feb 2023 09:21:08 +0200 Subject: [PATCH] fix: revert use graph API target url for access token Signed-off-by: drodil --- .changeset/eighty-geese-return.md | 5 +++++ .../src/microsoftGraph/client.test.ts | 2 +- .../src/microsoftGraph/client.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/eighty-geese-return.md diff --git a/.changeset/eighty-geese-return.md b/.changeset/eighty-geese-return.md new file mode 100644 index 0000000000..1f95e4843e --- /dev/null +++ b/.changeset/eighty-geese-return.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-msgraph': patch +--- + +revert ms graph token as it breaks the graph provider diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.test.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.test.ts index f7d98f12c6..f621b4d924 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.test.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.test.ts @@ -53,7 +53,7 @@ describe('MicrosoftGraphClient', () => { expect(await response.json()).toEqual({ value: 'example' }); expect(tokenCredential.getToken).toHaveBeenCalledTimes(1); expect(tokenCredential.getToken).toHaveBeenCalledWith( - 'https://example.com/.default', + 'https://graph.microsoft.com/.default', ); }); diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts index 7a685b258d..c644e545d6 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts @@ -219,7 +219,7 @@ export class MicrosoftGraphClient { ): Promise { // Make sure that we always have a valid access token (might be cached) const token = await this.tokenCredential.getToken( - `${this.baseUrl}/.default`, + 'https://graph.microsoft.com/.default', ); if (!token) {