getMicrosoftCloudFromAuth (common/microsoft-cloud.ts)

activepieces · packages/pieces/community/microsoft-teams/src/lib/common/microsoft-cloud.ts · typescript · MIT
auth, tag:embed-classified

Functions to determine Microsoft cloud environment and Graph API base URL for Teams.

// 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 GRAPH_BASE_URLS: Record<string, string> = {
  [COMMERCIAL_LOGIN_HOST]: 'https://graph.microsoft.com',
  [GOV_LOGIN_HOST]: 'https://graph.microsoft.us',
};

export const microsoftCloudProperty = Property.StaticDropdown({
  displayName: 'Cloud Environment',
  description: 'Select your Microsoft cloud environment.',
  required: true,
  defaultValue: COMMERCIAL_LOGIN_HOST,
  options: {
    disabled: false,
    options: [
      

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

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

Get a free API key