generateAuthorizationUrl (oauth/helpers.ts)

jira.js · src/core/oauth/helpers.ts · typescript · MIT
auth

Module exposing: generateAuthorizationUrl, exchangeAuthorizationCode, refreshOAuth2Token, getAccessibleResources, mapTokenResponse, requestJson

// Source: https://github.com/MrRefactoring/jira.js | License: MIT | Copyright 2020 Vladislav Tupikin
// Provided via justclaw.it.com; keep this notice with the code.
import type { AccessibleResource, OAuth2TokenResponse } from './types.js';
import type { FetchLike } from '../schemas/clientConfig.js';
import { OAuthError } from '../errors/index.js';

const AUTHORIZE_URL = 'https://auth.atlassian.com/authorize';
const TOKEN_URL = 'https://auth.atlassian.com/oauth/token';
const ACCESSIBLE_RESOURCES_URL = 'https://api.atlassian.com/oauth/token/accessible-resources';
const DEFAULT_AUDIENCE = 'api.atlassian.com';
const JSON_HEADERS = { 'Content-Type': 'application/json', Accept: 'application/json' };

interface RawTokenResponse {
  access_token: string;
  refresh_token?: string;
  expires_in: n

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

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

Get a free API key