-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
have option to setup valid domains to login from
- removed redudent userinfo fetch instead parsed id_token for userinfo - added domains verification for OIDC in UI - incorporated review comments - tested with AWS cognito
- Loading branch information
Showing
8 changed files
with
144 additions
and
61 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
client/app/pages/settings/components/AuthSettings/OIDCLoginSettings.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { isEmpty, join } from "lodash"; | ||
import React from "react"; | ||
import Form from "antd/lib/form"; | ||
import Select from "antd/lib/select"; | ||
import Alert from "antd/lib/alert"; | ||
import DynamicComponent from "@/components/DynamicComponent"; | ||
import { clientConfig } from "@/services/auth"; | ||
import { SettingsEditorPropTypes, SettingsEditorDefaultProps } from "../prop-types"; | ||
|
||
export default function OIDCLoginSettings(props) { | ||
const { values, onChange } = props; | ||
|
||
if (!clientConfig.oidcLoginEnabled) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<DynamicComponent name="OrganizationSettings.OIDCLoginSettings" {...props}> | ||
<h4>OIDC Login</h4> | ||
<Form.Item label="Allowed Domains"> | ||
<Select | ||
mode="tags" | ||
value={values.auth_oidc_domains} | ||
onChange={value => onChange({ auth_oidc_domains: value })} | ||
/> | ||
{!isEmpty(values.auth_oidc_domains) && ( | ||
<Alert | ||
message={ | ||
<p> | ||
Any user registered with a <strong>{join(values.auth_oidc_domains, ", ")} </strong> | ||
<span> </span>domain will be able to login. If they don't have an existing user, a new user will be created and join | ||
the <strong>Default</strong> group. | ||
</p> | ||
} | ||
className="m-t-15" | ||
/> | ||
)} | ||
</Form.Item> | ||
</DynamicComponent> | ||
); | ||
} | ||
|
||
OIDCLoginSettings.propTypes = SettingsEditorPropTypes; | ||
|
||
OIDCLoginSettings.defaultProps = SettingsEditorDefaultProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters