2022-05-27 15:43:42 +08:00
|
|
|
import path from 'path';
|
|
|
|
|
|
|
|
import { ConnectorMetadata, ConnectorType, ConnectorPlatform } from '@logto/connector-types';
|
|
|
|
import { getFileContents } from '@logto/shared';
|
|
|
|
|
|
|
|
// https://appleid.apple.com/.well-known/openid-configuration
|
|
|
|
export const issuer = 'https://appleid.apple.com';
|
|
|
|
export const authorizationEndpoint = `${issuer}/auth/authorize`;
|
|
|
|
export const accessTokenEndpoint = `${issuer}/auth/token`;
|
|
|
|
export const jwksUri = `${issuer}/auth/keys`;
|
|
|
|
|
|
|
|
// Note: only support fixed scope for v1.
|
|
|
|
export const scope = ''; // Note: `openid` is required when adding more scope(s)
|
|
|
|
|
|
|
|
// eslint-disable-next-line unicorn/prefer-module
|
|
|
|
const currentPath = __dirname;
|
|
|
|
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
|
2022-05-31 12:58:24 +08:00
|
|
|
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
|
2022-05-27 15:43:42 +08:00
|
|
|
const readmeContentFallback = 'Please check README.md file directory.';
|
2022-05-31 12:58:24 +08:00
|
|
|
const configTemplateFallback = 'Please check config-template.json file directory.';
|
2022-05-27 15:43:42 +08:00
|
|
|
|
|
|
|
export const defaultMetadata: ConnectorMetadata = {
|
|
|
|
id: 'apple-universal',
|
|
|
|
target: 'apple',
|
|
|
|
type: ConnectorType.Social,
|
|
|
|
platform: ConnectorPlatform.Universal,
|
|
|
|
name: {
|
|
|
|
en: 'Apple',
|
|
|
|
'zh-CN': 'Apple',
|
|
|
|
},
|
|
|
|
logo: './logo.svg',
|
2022-06-23 11:12:29 +08:00
|
|
|
logoDark: './logo-dark.svg',
|
2022-05-27 15:43:42 +08:00
|
|
|
description: {
|
|
|
|
en: 'Sign In with Apple',
|
|
|
|
'zh-CN': 'Apple 登录',
|
|
|
|
},
|
|
|
|
readme: getFileContents(pathToReadmeFile, readmeContentFallback),
|
|
|
|
configTemplate: getFileContents(pathToConfigTemplate, configTemplateFallback),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const defaultTimeout = 5000;
|