fix: use graph API target url for access token
this fixes #15998 Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend-module-msgraph': patch
|
||||
---
|
||||
|
||||
Fix MS Graph provider to use target URL for fetching access token
|
||||
@@ -53,7 +53,7 @@ describe('MicrosoftGraphClient', () => {
|
||||
expect(await response.json()).toEqual({ value: 'example' });
|
||||
expect(tokenCredential.getToken).toHaveBeenCalledTimes(1);
|
||||
expect(tokenCredential.getToken).toHaveBeenCalledWith(
|
||||
'https://graph.microsoft.com/.default',
|
||||
'https://example.com/.default',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ export class MicrosoftGraphClient {
|
||||
): Promise<Response> {
|
||||
// Make sure that we always have a valid access token (might be cached)
|
||||
const token = await this.tokenCredential.getToken(
|
||||
'https://graph.microsoft.com/.default',
|
||||
`${this.baseUrl}/.default`,
|
||||
);
|
||||
|
||||
if (!token) {
|
||||
|
||||
Reference in New Issue
Block a user