Add explicit login/logout flows and browser selection
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { loginInteractive } from "../azure/index.js";
|
||||
import { Client } from "@microsoft/microsoft-graph-client";
|
||||
import { acquireResourceTokenFromLogin } from "../azure/index.js";
|
||||
|
||||
/**
|
||||
* Initialize and return a Microsoft Graph client
|
||||
@@ -13,10 +13,10 @@ import { Client } from "@microsoft/microsoft-graph-client";
|
||||
* @returns { Promise<{ graphApiToken: Object, client: Object }> } An object containing the Graph API token and client
|
||||
*/
|
||||
export async function getGraphClient({ tenantId, clientId }) {
|
||||
const graphApiToken = await loginInteractive({
|
||||
const graphApiToken = await acquireResourceTokenFromLogin({
|
||||
tenantId,
|
||||
clientId,
|
||||
scopes: ["https://graph.microsoft.com/.default"],
|
||||
resource: "graph",
|
||||
});
|
||||
|
||||
const client = Client.init({
|
||||
|
||||
Reference in New Issue
Block a user