Skip to content

Commit

Permalink
fix(admin-ui): gentle push
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Jul 20, 2022
1 parent 8f33c39 commit b721cd7
Show file tree
Hide file tree
Showing 6 changed files with 846 additions and 47 deletions.
48 changes: 25 additions & 23 deletions admin-ui/app/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"persist_client_authorizations": "Persist Client Authorizations",
"policy_uri": "Policy URI",
"post_authn_scripts": "Post Authn Scripts",
"post_logout_redirect_uris": "Post Logout Redirect URIs",
"post_logout_redirect_uris": "Post logout redirect URI",
"pre_authorization": "Pre-Authorization",
"primary_key": "Primary Key",
"programming_language": "Programming Language",
Expand Down Expand Up @@ -173,37 +173,39 @@
"run_introspection_script_before_accesstoken": "Run Introspection Script Before AccessToken As Jwt Creation And Include Claims",
"keep_client_authorization": "Keep Client Authorization After Expiration",
"allow_spontaneous_scopes": "Allow Spontaneous Scopes",
"backchannelLogoutSessionRequired": "Back Channel Logout Session Required",
"backchannelLogoutUri": "Back Channel Logout URI",
"additionalAudience": "Additional Audience",
"accessTokenAsJwt": "Access Token as JWT",
"requireAuthTime": "Require AuthTime",
"rptAsJwt": "Rpt As Jwt",
"includeClaimsInIdToken": "Include Claims In IdToken",
"frontChannelLogoutSessionRequired": "Logout Session Required",
"backchannelLogoutSessionRequired": "Back channel. logout session required",
"backchannelLogoutUri": "Back channel. logout URI",
"additionalAudience": "Access token additional audiences",
"accessTokenAsJwt": "Access token type",
"requireAuthTime": "Add auth_time to id_token",
"rptAsJwt": "RPT token type",
"includeClaimsInIdToken": "Include claims in id_token",
"frontChannelLogoutSessionRequired": "Front channel. logout session required",
"clientUri": "Client URI",
"trusted_host": "Trusted Host ?",
"initiateLoginUri": "Initiate Login URI",
"tosUri": "Terms of service URI",
"idTokenTokenBindingCnf": "IdToken Binding Confirmation method",
"refreshTokenLifetime": "Refresh Token Lifetime",
"idTokenTokenBindingCnf": "Token binding confirmation method for id_token",
"refreshTokenLifetime": "Refresh token lifetime",
"oxdId": "Oxd Id",
"defaultMaxAge": "Default Maximun Authentication Age",
"accessTokenLifetime": "Access Token Lifetime",
"defaultMaxAge": "Default max authn age",
"accessTokenLifetime": "Access token lifetime",
"show_software_settings": "Show Software related settings ?",
"show_ciba_settings": "Show CIBA related settings ?",
"backchannelTokenDeliveryMode": "CIBA Token Delivery Mode",
"backchannelClientNotificationEndpoint": "CIBA Client Notification Endpoint",
"backchannelUserCodeParameter": "CIBA User Code Parameter?",
"frontChannelLogoutUri": "Front Channel Logout URI",
"backchannelTokenDeliveryMode": "Token delivery method",
"backchannelClientNotificationEndpoint": "Client notification endpoint ",
"backchannelUserCodeParameter": "Require user code param",
"frontChannelLogoutUri": "Front channel. logout URI",
"contacts": "Contacts",
"claimRedirectURIs": "Claim Redirect URIs",
"claimRedirectURIs": "Claims redirect URI",
"parLifetime": "Require lifetime",
"requirePar": "Require PAR",
"requestUris": "Request URIs",
"authorizedOrigins": "Authorized Javascript Origins",
"authorizedOrigins": "Authorized JS origins",
"defaultAcrValues": "Default Acr Values",
"softwareId": "Software Id",
"softwareVersion": "Software Version",
"softwareStatement": "'Software Statement",
"softwareId": "Software id",
"softwareVersion": "Software version",
"softwareStatement": "Software statement",
"usage_type": "Usage Type",
"script_path": "Script Path",
"use_anonymous_bind": "Use Anonymous Bind",
Expand Down Expand Up @@ -729,7 +731,7 @@
"frontChannelLogoutUri": "The front channel logout Uri",
"backchannelLogoutUri": "The back channel logout Uri",
"additionalAudience": "The client audiences",
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": "Run Introspection Script Before AccessToken As Jwt Creation And Include Claims",
"runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims": "Run introspection script before JWT access token",
"keepClientAuthorizationAfterExpiration": "Keep Client Authorization After Expiration",
"allowSpontaneousScopes": "Allow Spontaneous Scopes",
"backchannelLogoutSessionRequired": "Back channel Logout Session Required",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import React, { useState } from 'react'
import { Col, Container, FormGroup } from 'Components'
import GluuLabel from 'Routes/Apps/Gluu/GluuLabel'
import GluuTypeAheadForDn from 'Routes/Apps/Gluu/GluuTypeAheadForDn'
import GluuSelectRow from 'Routes/Apps/Gluu/GluuSelectRow'
import GluuToogleRow from 'Routes/Apps/Gluu/GluuToogleRow'
import GluuInputRow from 'Routes/Apps/Gluu/GluuInputRow'
import GluuTypeAheadWithAdd from 'Routes/Apps/Gluu/GluuTypeAheadWithAdd'
import Toggle from 'react-toggle'
import { useTranslation } from 'react-i18next'
import { FormControlLabel, Radio, RadioGroup } from '@material-ui/core'
const DOC_CATEGORY = 'openid_client'

function ClientCibaParUmaPanel({ client, scripts, formik }) {
const { t } = useTranslation()
const claim_uri_id = 'claim_uri_id'
const request_uri_id = 'request_uri_id'
const origin_uri_id = 'origin_uri_id'
const contact_uri_id = 'contact_uri_id'
const cibaDeliveryModes = ['poll', 'push', 'ping']
const contacts = []
const claimRedirectURI = []
const requestUris = []
const authorizedOrigins = []
scripts = scripts
.filter((item) => item.scriptType == 'PERSON_AUTHENTICATION')
.filter((item) => item.enabled)
.map((item) => ({ dn: item.dn, name: item.name }))
function uriValidator(uri) {
return uri
}
function getMapping(partial, total) {
if (!partial) {
partial = []
}
return total.filter((item) => partial.includes(item.dn))
}
const [softwareSection, setSoftwareSection] = useState(false)
const [cibaSection, setCibaSection] = useState(false)

function handleCibaSection() {
setCibaSection(!cibaSection)
}
function handleSoftwareSection() {
setSoftwareSection(!softwareSection)
}
function emailValidator(email) {
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
email,
)
}
return (
<Container>
<h2>CIBA</h2>
<GluuSelectRow
name="backchannelTokenDeliveryMode"
label="fields.backchannelTokenDeliveryMode"
formik={formik}
value={client.backchannelTokenDeliveryMode}
values={cibaDeliveryModes}
doc_category={DOC_CATEGORY}
></GluuSelectRow>
<GluuInputRow
label="fields.backchannelClientNotificationEndpoint"
name="backchannelClientNotificationEndpoint"
formik={formik}
value={client.backchannelClientNotificationEndpoint}
doc_category={DOC_CATEGORY}
/>

<GluuToogleRow
name="backchannelUserCodeParameter"
formik={formik}
label="fields.backchannelUserCodeParameter"
value={client.backchannelUserCodeParameter}
doc_category={DOC_CATEGORY}
/>
<h2>PAR</h2>
<GluuInputRow
label="fields.parLifetime"
name="parLifetime"
formik={formik}
value={client.parLifetime}
doc_category={DOC_CATEGORY}
/>
<GluuToogleRow
name="requirePar"
formik={formik}
label="fields.requirePar"
value={client.requirePar}
doc_category={DOC_CATEGORY}
/>
<h2>UMA</h2>
<FormGroup row>
<GluuLabel label="fields.rptAsJwt" size={6} />
<Col sm={6}>
<RadioGroup
row
name="accessTokenAsJwt"
value={client.rptAsJwt || true}
onChange={(e) => {
formik.setFieldValue('rptAsJwt', e.target.value == 'true')
}}
>
<FormControlLabel
value={true}
control={<Radio color="primary" />}
label="JWT"
checked={client.rptAsJwt == true}
/>
<FormControlLabel
value={false}
control={<Radio color="primary" />}
label="Reference"
checked={client.rptAsJwt == false}
/>
</RadioGroup>
</Col>
</FormGroup>
{/* <GluuToogleRow
name="rptAsJwt"
lsize={9}
rsize={3}
formik={formik}
label="fields.rptAsJwt"
value={client.rptAsJwt}
doc_category={DOC_CATEGORY}
/> */}

<GluuTypeAheadWithAdd
name="claimRedirectURIs"
label="fields.claimRedirectURIs"
formik={formik}
placeholder={t('Enter a valid claim uri eg') + ' https://...'}
value={client.claimRedirectUris || []}
options={claimRedirectURI}
validator={uriValidator}
inputId={claim_uri_id}
doc_category={DOC_CATEGORY}
></GluuTypeAheadWithAdd>
</Container>
)
}

export default ClientCibaParUmaPanel
120 changes: 120 additions & 0 deletions admin-ui/plugins/auth-server/components/Clients/ClientLogoutPanel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import React, { useState } from 'react'
import { Col, Container, FormGroup } from 'Components'
import GluuLabel from 'Routes/Apps/Gluu/GluuLabel'
import GluuTypeAheadForDn from 'Routes/Apps/Gluu/GluuTypeAheadForDn'
import GluuSelectRow from 'Routes/Apps/Gluu/GluuSelectRow'
import GluuToogleRow from 'Routes/Apps/Gluu/GluuToogleRow'
import GluuInputRow from 'Routes/Apps/Gluu/GluuInputRow'
import GluuTypeAheadWithAdd from 'Routes/Apps/Gluu/GluuTypeAheadWithAdd'
import GluuBooleanSelectBox from 'Routes/Apps/Gluu/GluuBooleanSelectBox'
import Toggle from 'react-toggle'
import { useTranslation } from 'react-i18next'
const DOC_CATEGORY = 'openid_client'

function ClientLogoutPanel({ client, scripts, formik }) {
const { t } = useTranslation()
const claim_uri_id = 'claim_uri_id'
const request_uri_id = 'request_uri_id'
const origin_uri_id = 'origin_uri_id'
const contact_uri_id = 'contact_uri_id'
const cibaDeliveryModes = ['poll', 'push', 'ping']
const contacts = []
const claimRedirectURI = []
const requestUris = []
const authorizedOrigins = []
scripts = scripts
.filter((item) => item.scriptType == 'PERSON_AUTHENTICATION')
.filter((item) => item.enabled)
.map((item) => ({ dn: item.dn, name: item.name }))
function uriValidator(uri) {
return uri
}
function getMapping(partial, total) {
if (!partial) {
partial = []
}
return total.filter((item) => partial.includes(item.dn))
}
const [softwareSection, setSoftwareSection] = useState(false)
const [cibaSection, setCibaSection] = useState(false)

function handleCibaSection() {
setCibaSection(!cibaSection)
}
function handleSoftwareSection() {
setSoftwareSection(!softwareSection)
}
function emailValidator(email) {
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
email,
)
}

const postLogoutRedirectUris = []
function postUriValidator(uri) {
return uri
}
const post_uri_id = 'post_uri_id'

const backchannelLogoutUris = []
function uriValidator(uri) {
return uri
}
const backchannel_uri_id = 'backchannel_uri_id'

return (
<Container>
<GluuInputRow
label="fields.frontChannelLogoutUri"
name="frontChannelLogoutUri"
formik={formik}
value={client.frontChannelLogoutUri}
doc_category={DOC_CATEGORY}
/>
<GluuTypeAheadWithAdd
name="postLogoutRedirectUris"
label="fields.post_logout_redirect_uris"
formik={formik}
placeholder={t('placeholders.post_logout_redirect_uris')}
value={client.postLogoutRedirectUris || []}
options={postLogoutRedirectUris}
validator={postUriValidator}
inputId={post_uri_id}
doc_category={DOC_CATEGORY}
></GluuTypeAheadWithAdd>

<GluuTypeAheadWithAdd
name="backchannelLogoutUri"
label="fields.backchannelLogoutUri"
formik={formik}
placeholder={t('Enter a valid uri with pattern') + ' https://'}
value={client.backchannelLogoutUri || []}
options={backchannelLogoutUris}
validator={uriValidator}
inputId={backchannel_uri_id}
doc_category={DOC_CATEGORY}
></GluuTypeAheadWithAdd>
<GluuBooleanSelectBox
name="backchannelLogoutSessionRequired"
label="fields.backchannelLogoutSessionRequired"
value={client.backchannelLogoutSessionRequired}
formik={formik}
lsize={8}
rsize={4}
doc_category={DOC_CATEGORY}
/>

<GluuToogleRow
name="frontChannelLogoutSessionRequired"
lsize={9}
rsize={3}
formik={formik}
label="fields.frontChannelLogoutSessionRequired"
value={client.frontChannelLogoutSessionRequired}
doc_category={DOC_CATEGORY}
/>
</Container>
)
}

export default ClientLogoutPanel
Loading

0 comments on commit b721cd7

Please sign in to comment.