getMicrosoftCloudFromAuth (common/microsoft-cloud.ts)

activepieces · packages/pieces/community/microsoft-outlook/src/lib/common/microsoft-cloud.ts · typescript · MIT
auth

Provides Microsoft cloud selection and Graph base URL for Outlook integration.

// Source: https://github.com/activepieces/activepieces | License: MIT | Copyright 2020-2024 Activepieces Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { OAuth2PropertyValue, Property } from '@activepieces/pieces-framework';

const COMMERCIAL_LOGIN_HOST = 'login.microsoftonline.com';
const GOV_LOGIN_HOST = 'login.microsoftonline.us';

const DELEGATED_SCOPE = 'Mail.ReadWrite Mail.Send Calendars.Read offline_access User.Read openid email profile';
const APP_ONLY_COMMERCIAL_SCOPE = 'https://graph.microsoft.com/.default';
const APP_ONLY_GOV_SCOPE = 'https://graph.microsoft.us/.default';

const GRAPH_BASE_URLS: Record<string, string> = {
  [COMMERCIAL_LOGIN_HOST]: 'https://graph.microsoft.com',
  [GOV_LOGIN_HOST]: 'https://graph.microsoft.us',
};

export const micr

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key