0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-03 22:15:32 -05:00
logto/packages/connectors/connector-dingtalk-web/src/constant.ts
aiden 87bffee3f4
feat(connector): add dingtalk connector (#5915)
* feat: add dingtalk connector

* refactor(connector): optimize codes

* refactor(connector): optimize the logic of getting user phone

* docs(connector): add English configuration guide for DingTalk

* docs(connector): add table of contents

* docs(connector): optimize format

---------

Co-authored-by: aidenlu <aiden_lu@wochacha.com>
2024-05-29 15:15:45 +08:00

60 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { ConnectorMetadata } from '@logto/connector-kit';
import { ConnectorConfigFormItemType, ConnectorPlatform } from '@logto/connector-kit';
// https://open.dingtalk.com/document/orgapp-server/use-dingtalk-account-to-log-on-to-third-party-websites-1
export const authorizationEndpoint = 'https://login.dingtalk.com/oauth2/auth';
// https://open.dingtalk.com/document/isvapp/obtain-user-token
export const accessTokenEndpoint = 'https://api.dingtalk.com/v1.0/oauth2/userAccessToken';
// https://open.dingtalk.com/document/isvapp/dingtalk-retrieve-user-information
// To obtain the current authorized person's information, the unionId parameter can be set to "me".
export const userInfoEndpoint = 'https://api.dingtalk.com/v1.0/contact/users/me';
export const scope = 'openid';
export const defaultMetadata: ConnectorMetadata = {
id: 'dingtalk-web',
target: 'dingtalk',
platform: ConnectorPlatform.Web,
name: {
en: 'DingTalk',
'zh-CN': '钉钉',
'tr-TR': 'DingTalk',
ko: 'DingTalk',
},
logo: './logo.svg',
logoDark: null,
description: {
en: 'DingTalk is an enterprise-level intelligent mobile office platform launched by Alibaba Group.',
'zh-CN': '钉钉是一个由阿里巴巴集团推出的企业级智能移动办公平台。',
'tr-TR':
'DingTalk, Alibaba Grubu tarafından piyasaya sürülen kurumsal düzeyde akıllı mobil ofis platformudur.',
ko: '딩톡은 알리바바 그룹이 출시한 기업용 지능형 모바일 오피스 플랫폼입니다.',
},
readme: './README.md',
formItems: [
{
key: 'clientId',
label: 'Client ID',
required: true,
type: ConnectorConfigFormItemType.Text,
placeholder: '<client-id>',
},
{
key: 'clientSecret',
label: 'Client Secret',
required: true,
type: ConnectorConfigFormItemType.Text,
placeholder: '<client-secret>',
},
{
key: 'scope',
type: ConnectorConfigFormItemType.Text,
label: 'Scope',
required: false,
placeholder: '<scope>',
description:
"The `scope` determines permissions granted by the user's authorization. If you are not sure what to enter, do not worry, just leave it blank.",
},
],
};
export const defaultTimeout = 5000;