/
index.js
63 lines (61 loc) 路 1.56 KB
/
index.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
import React from 'react';
import Select from '@/_ui/Select';
import Authentication from '@/_ui/OAuth/Authentication';
const OAuth = ({
auth_type,
grant_type,
access_token_url,
access_token_custom_headers,
client_id,
client_secret,
client_auth,
custom_auth_params,
custom_query_params,
scopes,
username,
password,
bearer_token,
auth_url,
header_prefix,
add_token_to,
multiple_auth_enabled,
optionchanged,
}) => {
return (
<>
<Select
options={[
{ name: 'None', value: 'none' },
{ name: 'Basic', value: 'basic' },
{ name: 'Bearer', value: 'bearer' },
{ name: 'OAuth 2.0', value: 'oauth2' },
]}
value={auth_type}
onChange={(value) => optionchanged('auth_type', value)}
width={'100%'}
useMenuPortal={false}
/>
<Authentication
add_token_to={add_token_to}
header_prefix={header_prefix}
access_token_url={access_token_url}
access_token_custom_headers={access_token_custom_headers}
auth_type={auth_type}
grant_type={grant_type}
optionchanged={optionchanged}
custom_auth_params={custom_auth_params}
custom_query_params={custom_query_params}
client_id={client_id}
client_secret={client_secret}
client_auth={client_auth}
multiple_auth_enabled={multiple_auth_enabled}
scopes={scopes}
username={username}
password={password}
bearer_token={bearer_token}
auth_url={auth_url}
/>
</>
);
};
export default OAuth;