Skip to content

Commit ab83f44

Browse files
Merge pull request #2618 from BNWEIN/dev
Added Authentication Methods
2 parents 11901fa + fabdeff commit ab83f44

File tree

5 files changed

+159
-1
lines changed

5 files changed

+159
-1
lines changed

src/_nav.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ const _nav = [
162162
name: 'App Consent Requests',
163163
to: '/tenant/administration/app-consent-requests',
164164
},
165+
{
166+
component: CNavItem,
167+
name: 'Authentication Methods',
168+
to: '/tenant/administration/authentication-methods',
169+
},
165170
{
166171
component: CNavItem,
167172
name: 'Tenant Onboarding',

src/data/alerts.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,10 @@
8989
"name": "DepTokenExpiry",
9090
"label": "Alert on expiring DEP tokens",
9191
"recommendedRunInterval": "1d"
92+
},
93+
{
94+
"name": "SoftDeletedMailboxes",
95+
"label": "Alert on soft deleted mailboxes",
96+
"recommendedRunInterval": "1d"
9297
}
93-
]
98+
]

src/importsMap.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import React from 'react'
5353
"/tenant/conditional/deploy-named-location": React.lazy(() => import('./views/tenant/conditional/DeployNamedLocation')),
5454
"/tenant/conditional/list-template": React.lazy(() => import('./views/tenant/conditional/ListCATemplates')),
5555
"/tenant/conditional/add-template": React.lazy(() => import('./views/tenant/conditional/AddCATemplate')),
56+
"/tenant/administration/authentication-methods": React.lazy(() => import('./views/tenant/administration/AuthMethods')),
5657
"/tenant/administration/list-licenses": React.lazy(() => import('./views/tenant/administration/ListLicences')),
5758
"/tenant/administration/application-consent": React.lazy(() => import('./views/tenant/administration/ListOauthApps')),
5859
"/tenant/standards/list-applied-standards": React.lazy(() => import('./views/tenant/standards/ListAppliedStandards')),

src/routes.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@
300300
"component": "views/tenant/conditional/ConditionalAccess",
301301
"allowedRoles": ["admin", "editor", "readonly"]
302302
},
303+
{
304+
"path": "/tenant/administration/authentication-methods",
305+
"name": "Authentication Methods",
306+
"component": "views/tenant/administration/AuthMethods",
307+
"allowedRoles": ["admin", "editor", "readonly"]
308+
},
303309
{
304310
"path": "/tenant/conditional/deploy-vacation",
305311
"name": "Deploy Vacation Mode",
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
import React, { useState } from 'react'
2+
import { CButton, CCardBody, CSpinner, CCard, CCardHeader, CCardTitle } from '@coreui/react'
3+
import { useSelector } from 'react-redux'
4+
import { faEllipsisV } from '@fortawesome/free-solid-svg-icons'
5+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
6+
import { CippPageList, CippPage } from 'src/components/layout'
7+
import { TitleButton } from 'src/components/buttons'
8+
import { CippActionsOffcanvas } from 'src/components/utilities'
9+
import { useGenericGetRequestQuery } from 'src/store/api/app'
10+
import { CippTable, cellBooleanFormatter } from 'src/components/tables'
11+
import { CellTip, cellGenericFormatter } from 'src/components/tables/CellGenericFormat'
12+
13+
const Offcanvas = (row, rowIndex, formatExtraData) => {
14+
const tenant = useSelector((state) => state.app.currentTenant)
15+
const [ocVisible, setOCVisible] = useState(false)
16+
const formatTargets = (targets) => {
17+
if (Array.isArray(targets)) {
18+
return targets.map((target) => JSON.stringify(target)).join(', ')
19+
}
20+
return targets
21+
}
22+
23+
return (
24+
<>
25+
<CButton size="sm" color="link" onClick={() => setOCVisible(true)}>
26+
<FontAwesomeIcon icon={faEllipsisV} />
27+
</CButton>
28+
<CippActionsOffcanvas
29+
title="Extended Information"
30+
extendedInfo={[
31+
{ label: 'id', value: `${row.id}` },
32+
{ label: 'state', value: `${row.state}` },
33+
{ label: 'includeTargets', value: formatTargets(row.includeTargets) },
34+
{ label: 'excludeTargets', value: formatTargets(row.excludeTargets) },
35+
]}
36+
actions={[
37+
{
38+
label: 'Enable Policy',
39+
color: 'info',
40+
modal: true,
41+
modalType: 'POST',
42+
modalBody: {
43+
id: row.id,
44+
state: 'enabled',
45+
TenantFilter: tenant.defaultDomainName,
46+
},
47+
modalUrl: `/api/SetAuthMethod`,
48+
modalMessage: 'Are you sure you want to enable this policy?',
49+
},
50+
{
51+
label: 'Disable Policy',
52+
color: 'info',
53+
modal: true,
54+
modalType: 'POST',
55+
modalBody: {
56+
id: row.id,
57+
state: 'disabled',
58+
TenantFilter: tenant.defaultDomainName,
59+
},
60+
modalUrl: `/api/SetAuthMethod`,
61+
modalMessage: 'Are you sure you want to enable this policy?',
62+
},
63+
]}
64+
placement="end"
65+
visible={ocVisible}
66+
id={row.id}
67+
hideFunction={() => setOCVisible(false)}
68+
/>
69+
</>
70+
)
71+
}
72+
73+
const columns = [
74+
{
75+
name: 'id',
76+
selector: (row) => row['id'],
77+
sortable: true,
78+
exportSelector: 'id',
79+
},
80+
{
81+
name: 'state',
82+
selector: (row) => row['state'],
83+
cell: cellBooleanFormatter({ colourless: false }),
84+
sortable: true,
85+
exportSelector: 'state',
86+
minWidth: '100px',
87+
},
88+
{
89+
name: 'includeTargets',
90+
selector: (row) => row['includeTargets'],
91+
sortable: true,
92+
cell: cellGenericFormatter(),
93+
exportSelector: 'includeTargets',
94+
},
95+
{
96+
name: 'excludeTargets',
97+
selector: (row) => row['excludeTargets'],
98+
sortable: true,
99+
cell: cellGenericFormatter(),
100+
exportSelector: 'excludeTargets',
101+
},
102+
{
103+
name: 'Actions',
104+
cell: Offcanvas,
105+
},
106+
]
107+
108+
const AuthenticationMethods = () => {
109+
const tenant = useSelector((state) => state.app.currentTenant)
110+
const { data, isFetching, error, isSuccess, refetch } = useGenericGetRequestQuery({
111+
path: 'api/ListGraphRequest',
112+
params: {
113+
Endpoint: 'authenticationMethodsPolicy',
114+
TenantFilter: tenant?.defaultDomainName,
115+
},
116+
})
117+
return (
118+
<>
119+
<CippPage title="Auth Methods" tenantSelector={true}>
120+
<CCard className="content-card">
121+
<CCardHeader className="d-flex justify-content-between align-items-center">
122+
<CCardTitle>Auth Methods</CCardTitle>
123+
</CCardHeader>
124+
<CCardBody>
125+
{isFetching && <CSpinner />}
126+
{isSuccess && (
127+
<CippTable
128+
reportName={`Auth Methods`}
129+
data={data?.Results[0]?.authenticationMethodConfigurations}
130+
columns={columns}
131+
refreshFunction={() => refetch()}
132+
/>
133+
)}
134+
</CCardBody>
135+
</CCard>
136+
</CippPage>
137+
</>
138+
)
139+
}
140+
141+
export default AuthenticationMethods

0 commit comments

Comments
 (0)