Repository navigation
Expand file tree
/
Copy pathauthentication.ts
More file actions
56 lines (56 loc) · 1.74 KB
/
Copy pathauthentication.ts
File metadata and controls
56 lines (56 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export const authentication = {
type: 'oauth2',
test: {
headers: {
accept: 'application/json',
authorization: 'bearer {{bundle.authData.access_token}}',
},
url: 'https://www.taskade.com/oauth2/ping',
},
oauth2Config: {
authorizeUrl: {
url: 'https://www.taskade.com/oauth2/authorize',
params: {
client_id: '{{process.env.CLIENT_ID}}',
state: '{{bundle.inputData.state}}',
redirect_uri: '{{bundle.inputData.redirect_uri}}',
response_type: 'code',
},
},
getAccessToken: {
body: {
code: '{{bundle.inputData.code}}',
client_id: '{{process.env.CLIENT_ID}}',
client_secret: '{{process.env.CLIENT_SECRET}}',
grant_type: 'authorization_code',
redirect_uri: '{{bundle.inputData.redirect_uri}}',
},
headers: {
'content-type': 'application/x-www-form-urlencoded',
accept: 'application/json',
},
method: 'POST',
url: 'https://www.taskade.com/oauth2/token',
},
refreshAccessToken: {
body: {
refresh_token: '{{bundle.authData.refresh_token}}',
// The token endpoint authenticates the client on every grant, refresh
// included (client_secret_post). Without these two fields, it rejects
// each refresh with "client_id is required".
client_id: '{{process.env.CLIENT_ID}}',
client_secret: '{{process.env.CLIENT_SECRET}}',
grant_type: 'refresh_token',
},
headers: {
'content-type': 'application/x-www-form-urlencoded',
accept: 'application/json',
},
method: 'POST',
url: 'https://www.taskade.com/oauth2/token',
},
scope: '*',
autoRefresh: true,
},
connectionLabel: '{{handle}}',
};