-
Notifications
You must be signed in to change notification settings - Fork 4
/
authentication.js
65 lines (65 loc) · 1.99 KB
/
authentication.js
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
57
58
59
60
61
62
63
64
65
module.exports = {
type: 'session',
test: {
url: 'https://{{bundle.authData.domain}}/api/v2/tenants/settings',
method: 'GET',
params: {
client_id: '{{bundle.authData.client_id}}',
domain: '{{bundle.authData.domain}}',
client_secret: '{{bundle.authData.client_secret}}',
},
headers: {
authorization: 'Bearer {{bundle.authData.access_token}}',
'X-CLIENT-ID': '{{bundle.authData.client_id}}',
'X-DOMAIN': '{{bundle.authData.domain}}',
'X-CLIENT-SECRET': '{{bundle.authData.client_secret}}',
},
body: {},
removeMissingValuesFrom: {},
},
fields: [
{
computed: false,
key: 'client_id',
required: true,
label: 'Client ID',
helpText:
'Go to the [Auth0 Dashboard](https://manage.auth0.com/dashboard/) and select your Application, then copy "Client ID".',
},
{
computed: false,
key: 'domain',
required: true,
label: 'Domain',
helpText:
'Go to the [Auth0 Dashboard](https://manage.auth0.com/dashboard/) and select your Application, then copy "Domain". *Ex: mysite.auth0.com*',
type: 'string',
inputFormat: ' https://{{input}}/',
},
{
computed: false,
key: 'client_secret',
required: true,
label: 'client_secret',
helpText:
'Go to the [Auth0 Dashboard](https://manage.auth0.com/dashboard/) and select your Application, then copy "Client Secret".',
type: 'password',
},
],
sessionConfig: {
perform: {
url: 'https://{{bundle.authData.domain}}/oauth/token',
method: 'POST',
params: {},
headers: { 'content-type': 'application/json' },
body: {
client_id: '{{bundle.authData.client_id}}',
client_secret: '{{bundle.authData.client_secret}}',
audience: 'https://{{bundle.authData.domain}}/api/v2/',
grant_type: 'client_credentials',
},
removeMissingValuesFrom: {},
},
},
connectionLabel: '{{bundle.inputData.friendly_name}}',
};