diff --git a/frontend/src/_components/DynamicForm.jsx b/frontend/src/_components/DynamicForm.jsx index df8b490f8d..2fc7ffceca 100644 --- a/frontend/src/_components/DynamicForm.jsx +++ b/frontend/src/_components/DynamicForm.jsx @@ -121,6 +121,9 @@ const DynamicForm = ({ client_secret: options.client_secret?.value, client_auth: options.client_auth?.value, scopes: options.scopes?.value, + username: options.username?.value, + password: options.password?.value, + bearer_token: options.bearer_token?.value, auth_url: options.auth_url?.value, custom_auth_params: options.custom_auth_params?.value, custom_query_params: options.custom_query_params?.value, diff --git a/frontend/src/_ui/OAuth/Authentication.jsx b/frontend/src/_ui/OAuth/Authentication.jsx index cf6ee91fb4..d4fc41d473 100644 --- a/frontend/src/_ui/OAuth/Authentication.jsx +++ b/frontend/src/_ui/OAuth/Authentication.jsx @@ -15,128 +15,188 @@ const Authentication = ({ header_prefix, grant_type, scopes, + username, + bearer_token, + password, auth_url, optionchanged, }) => { - if (auth_type !== 'oauth2') return null; - - return ( -
-
-

Authentication

-
- - optionchanged('add_token_to', value)} - width={'100%'} - useMenuPortal={false} - /> - - {add_token_to === 'header' && ( -
- - optionchanged('header_prefix', e.target.value)} - value={header_prefix} - /> -
- )} -
+ if (auth_type === 'oauth2') { + return ( +
+
+

Authentication

+
+ + optionchanged('add_token_to', value)} + width={'100%'} + useMenuPortal={false} + /> -
- - optionchanged('access_token_url', e.target.value)} - value={access_token_url} - /> -
+ {add_token_to === 'header' && ( +
+ + optionchanged('header_prefix', e.target.value)} + value={header_prefix} + /> +
+ )} +
-
- - optionchanged('client_id', e.target.value)} - value={client_id} - /> -
+
+ + optionchanged('access_token_url', e.target.value)} + value={access_token_url} + /> +
-
- - optionchanged('client_secret', e.target.value)} - value={client_secret} - /> -
+
+ + optionchanged('client_id', e.target.value)} + value={client_id} + /> +
-
- - optionchanged('scopes', e.target.value)} - value={scopes} - /> -
+
+ + optionchanged('client_secret', e.target.value)} + value={client_secret} + /> +
-
-
- +
+ + optionchanged('scopes', e.target.value)} + value={scopes} + />
-
- - {grant_type === 'authorization_code' && ( -
-
- - optionchanged('auth_url', e.target.value)} - value={auth_url} - /> +
+
+
+
+ -
-
- + {grant_type === 'authorization_code' && ( +
+
+ + optionchanged('auth_url', e.target.value)} + value={auth_url} + />
+ +
+
+ +
+
+ + + optionchanged('client_auth', value)} - width={'100%'} - useMenuPortal={false} + )} +
+ ); + } else if (auth_type === 'basic') { + return ( +
+
+ + optionchanged('username', e.target.value)} + value={username} />
- )} -
- ); +
+ + optionchanged('password', e.target.value)} + value={password} + /> +
+
+ ); + } else if (auth_type === 'bearer') { + return ( +
+
+ + optionchanged('bearer_token', e.target.value)} + value={bearer_token} + /> +
+
+ ); + } else { + return null; + } }; export default Authentication; diff --git a/frontend/src/_ui/OAuth/index.js b/frontend/src/_ui/OAuth/index.js index 4fafa04e9f..e4dc458812 100644 --- a/frontend/src/_ui/OAuth/index.js +++ b/frontend/src/_ui/OAuth/index.js @@ -12,6 +12,9 @@ const OAuth = ({ custom_auth_params, custom_query_params, scopes, + username, + password, + bearer_token, auth_url, header_prefix, add_token_to, @@ -22,6 +25,8 @@ const OAuth = ({