Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(OSP): added auth url field in IDP config creation #1280

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2261,8 +2261,12 @@
"success": "OSP-Rückruf erfolgreich konfiguriert",
"callbackUrlError": "Fehler beim Konfigurieren des OSP-Rückrufs",
"callbackUrl": {
"name": "Rückruf-URL",
"hint": "Geben Sie die Rückruf-URL Ihres IDP ein, die mit „/.well-known/openid-configuration“ endet'"
"name": "Statusrückruf URL",
"hint": "Statusrückruf URL ist verpflichtend"
},
"authUrl": {
"name": "Auth URL",
"hint": "Statusrückruf URL ist verpflichtend"
},
"clientId": {
"name": "Kunden-ID",
Expand Down
6 changes: 5 additions & 1 deletion src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2236,7 +2236,11 @@
"callbackUrlError": "Failed configuring OSP callback",
"callbackUrl": {
"name": "Callback URL",
"hint": "Enter the callback URL from your IDP that ends with '/.well-known/openid-configuration'"
"hint": "Status callback URL is mandatory"
},
"authUrl": {
"name": "Auth URL",
"hint": "Auth URL is mandatory"
},
"clientId": {
"name": "Client ID",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ const OnboardingServiceProvider = () => {
)
}

const isWellknownMetadata = (expr: string) =>
isURL(expr) && expr.endsWith('.well-known/openid-configuration')

const updateCallbackIDP = async () => {
if (!(data && callbackData)) return
setLoading(true)
Expand Down Expand Up @@ -127,7 +124,7 @@ const OnboardingServiceProvider = () => {
callbackUrl: current.callbackUrl,
clientId: current.clientId,
clientSecret: current.clientSecret,
authUrl: '',
authUrl: current.authUrl,
}
: undefined
)
Expand Down Expand Up @@ -172,13 +169,24 @@ const OnboardingServiceProvider = () => {
'content.onboardingServiceProvider.callbackUrl.name'
)}
value={data?.callbackUrl}
validate={(expr) => isWellknownMetadata(expr)}
validate={(expr) => isURL(expr)}
Usmanfee marked this conversation as resolved.
Show resolved Hide resolved
hint={t('content.onboardingServiceProvider.callbackUrl.hint')}
debounceTime={0}
onValid={checkValidData}
/>
</div>
<div style={{ margin: '12px 0' }}>
<div style={{ marginTop: '34px' }}>
Usmanfee marked this conversation as resolved.
Show resolved Hide resolved
<ValidatingInput
name="authUrl"
label={t('content.onboardingServiceProvider.authUrl.name')}
value={data?.authUrl}
validate={(expr) => isURL(expr)}
hint={t('content.onboardingServiceProvider.authUrl.hint')}
debounceTime={0}
onValid={checkValidData}
/>
</div>
<div style={{ margin: '15px 0' }}>
<ValidatingInput
name="clientId"
label={t('content.onboardingServiceProvider.clientId.name')}
Expand Down
Loading