diff --git a/addons/api/addon/adapters/application.js b/addons/api/addon/adapters/application.js
index 279e9b73f..12112ed67 100644
--- a/addons/api/addon/adapters/application.js
+++ b/addons/api/addon/adapters/application.js
@@ -248,7 +248,11 @@ export default class ApplicationAdapter extends RESTAdapter.extend(
// Normalize field-specific errors, if any.
const errors = fieldErrors.map((error) => ({
detail: error.description,
- source: { pointer: `/data/attributes/${error.name}` },
+ // Ember Data cannot handle errors on nested attributes, so these are
+ // flattened (e.g. `attributes.foobar` becomes `attributes_foobar`).
+ // To capture these errors, add read-only fields on the model
+ // corresponding to the underscored field name.
+ source: { pointer: `/data/attributes/${error.name.replace('.', '_')}` },
}));
// Return a list of JSON API errors rooted under the `errors` key.
return {
diff --git a/addons/api/addon/models/auth-method.js b/addons/api/addon/models/auth-method.js
index 1ba8050a9..1b2cf8182 100644
--- a/addons/api/addon/models/auth-method.js
+++ b/addons/api/addon/models/auth-method.js
@@ -1,4 +1,5 @@
import GeneratedAuthMethodModel from '../generated/models/auth-method';
+import { attr } from '@ember-data/model';
import { fragment } from 'ember-data-model-fragments/attributes';
import { equal } from '@ember/object/computed';
@@ -29,6 +30,26 @@ export const options = {
export default class AuthMethodModel extends GeneratedAuthMethodModel {
STATES_ENUM = options.oidc.state;
+ // =error attributes
+ // These attributes exist solely to capture errors on nested fields.
+ // See the application adapter's error normalization method for
+ // more information.
+
+ @attr('string', { readOnly: true }) attributes_state;
+ @attr('string', { readOnly: true }) attributes_issuer;
+ @attr('string', { readOnly: true }) attributes_client_id;
+ @attr('string', { readOnly: true }) attributes_client_secret;
+ @attr('string', { readOnly: true }) attributes_max_age;
+ @attr('string', { readOnly: true }) attributes_api_url_prefix;
+ @attr('string', { readOnly: true })
+ attributes_disable_discovered_config_validation;
+ @attr('string', { readOnly: true }) attributes_dry_run;
+ @attr('string', { readOnly: true }) attributes_account_claim_maps;
+ @attr('string', { readOnly: true }) attributes_claims_scopes;
+ @attr('string', { readOnly: true }) attributes_signing_algorithms;
+ @attr('string', { readOnly: true }) attributes_allowed_audiences;
+ @attr('string', { readOnly: true }) attributes_idp_ca_certs;
+
// =attributes
/**
diff --git a/addons/core/translations/en-us.yaml b/addons/core/translations/en-us.yaml
index 56621bf33..5370c7e75 100644
--- a/addons/core/translations/en-us.yaml
+++ b/addons/core/translations/en-us.yaml
@@ -27,6 +27,8 @@ titles:
abandon-confirm: Discard unsaved changes?
toggle-color-theme: Toggle Color Theme
welcome-to-boundary: Welcome to Boundary
+ label: Label
+ value: Value
descriptions:
empty-set: There are no items to display yet. You may be able to add items or try back later.
origin-initialization: To get started, please enter your origin URL
diff --git a/addons/core/translations/form/en-us.yaml b/addons/core/translations/form/en-us.yaml
index 974b2d313..65277af78 100644
--- a/addons/core/translations/form/en-us.yaml
+++ b/addons/core/translations/form/en-us.yaml
@@ -59,7 +59,7 @@ client_id:
help: An OAuth 2.0 Client Identifier valid at the Authorization Server.
client_secret:
label: Client Secret
- description: The client secret is set-only, may not be unset, and will not appear after a successful save.
+ help: The client secret is set-only and may not be unset.
max_age:
label: Maximum Age
help: The OIDC "max_age" parameter sent to the Authorization Server indicating a maximum acceptable time in seconds since the user's last authentication before requiring the user to reauthenticate. 0 indicates an immediate need to reauthenticate.
@@ -70,3 +70,33 @@ disable_discovered_config_validation:
label: Disable discovered config validation
help: >
If the Authorization Server's discovered configuration contains values that do not match the configuration set on this auth method, this can be set to force the local configuration to override the discovered values. This is useful in the case of slow-changing or incorrect values announced by the Authorization Server. NOTE: For safety, not providing this value will be treated the same as "false"; that is, every time the method is updated or the state is changed, this value must be set to "true" or it will be disabled.
+idp_ca_certs:
+ label: Certificates
+ help: Optional PEM-encoded X.509 CA certificates that can be used as trust anchors when connecting to an OIDC provider.
+certificate:
+ label: Certificate
+allowed_audiences:
+ label: Allowed Audiences
+ help: Allowed audience claims for this auth method.
+claim:
+ label: Claim
+claims_scopes:
+ label: Claims Scopes
+ help: Optional claims scopes that will be requested during authentication.
+claims_scope:
+ label: Claims Scope
+account_claim_maps:
+ label: Account Claim Maps
+ help: >
+ Optional claim maps from custom claims to the standard claims of sub, name and email. These maps are represented as key=value where the key equals the from_claim and the value equals the to_claim. For example "oid=sub".
+account_claim_map:
+ label: Account Claim Map
+from_claim:
+ label: From Claim
+to_claim:
+ label: To Claim
+signing_algorithms:
+ label: Signing Algorithms
+ help: The signing algorithms allowed for the auth method.
+algorithm:
+ label: Algorithm
diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml
index aa42e8d53..0cab323c1 100644
--- a/addons/core/translations/resources/en-us.yaml
+++ b/addons/core/translations/resources/en-us.yaml
@@ -30,6 +30,13 @@ auth-method:
pending:
title: Authentication Pending
description: Complete authentication in the newly-opened window.
+ titles:
+ new-signing-algorithm: New Signing Algorithm
+ new-allowed-audience: New Allowed Audience
+ new-claims-scope: New Claims Scope
+ new-from-claim: New From Claim
+ new-to-claim: New To Claim
+ new-certificate: New Certificate
types:
password: Password
oidc: OIDC
diff --git a/addons/rose/addon/components/rose/form/index.hbs b/addons/rose/addon/components/rose/form/index.hbs
index 80b027371..8c545ec22 100644
--- a/addons/rose/addon/components/rose/form/index.hbs
+++ b/addons/rose/addon/components/rose/form/index.hbs
@@ -30,5 +30,6 @@
cancel=this.handleCancel
enableEdit=this.enableEdit
)
+ isEditable=this.isEditable
)}}
diff --git a/addons/rose/addon/styles/rose/components/form/_fieldset.scss b/addons/rose/addon/styles/rose/components/form/_fieldset.scss
index 8696ad562..d0b35d2ea 100644
--- a/addons/rose/addon/styles/rose/components/form/_fieldset.scss
+++ b/addons/rose/addon/styles/rose/components/form/_fieldset.scss
@@ -2,6 +2,8 @@
@use '../../utilities/type';
.rose-form-fieldset {
+ margin-bottom: sizing.rems(m);
+
.rose-form-fieldset-title {
@include type.type(l, bold);
}
diff --git a/addons/rose/addon/styles/rose/components/table/_table.scss b/addons/rose/addon/styles/rose/components/table/_table.scss
index 81a815a24..c4a839020 100644
--- a/addons/rose/addon/styles/rose/components/table/_table.scss
+++ b/addons/rose/addon/styles/rose/components/table/_table.scss
@@ -11,13 +11,19 @@
}
// This styles are add to stop the input to apply extra margin (default on forms)
+ .rose-form-input,
.rose-form-input-field,
.rose-form-select,
- .rose-form-input {
+ .rose-form-select-field {
margin: 0;
width: 100%;
}
+ // Fix margin issue with textarea elements inside tables
+ textarea {
+ display: block;
+ }
+
.rose-table-cell,
.rose-table-header-cell {
vertical-align: middle;
diff --git a/ui/admin/app/components/form/auth-method/index.hbs b/ui/admin/app/components/form/auth-method/index.hbs
index 478c2ea91..77cf37d4d 100644
--- a/ui/admin/app/components/form/auth-method/index.hbs
+++ b/ui/admin/app/components/form/auth-method/index.hbs
@@ -4,5 +4,8 @@
model=@model
submit=@submit
cancel=@cancel
+ removeItemByIndex=@removeItemByIndex
+ addStringItem=@addStringItem
+ addAccountClaimMapItem=@addAccountClaimMapItem
}}
{{/if}}
\ No newline at end of file
diff --git a/ui/admin/app/components/form/auth-method/oidc/index.hbs b/ui/admin/app/components/form/auth-method/oidc/index.hbs
index f157e5090..e1a5592c0 100644
--- a/ui/admin/app/components/form/auth-method/oidc/index.hbs
+++ b/ui/admin/app/components/form/auth-method/oidc/index.hbs
@@ -39,7 +39,6 @@
@label={{t 'form.description.label'}}
@helperText={{t 'form.description.help'}}
@error={{@model.errors.description}}
- disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
@@ -58,13 +57,13 @@
@value={{@model.attributes.issuer}}
@label={{t 'form.issuer.label'}}
@helperText={{t 'form.issuer.help'}}
- @error={{@model.errors.attributes.issuer}}
+ @error={{@model.errors.attributes_issuer}}
readonly={{false}}
as |field|
>
- {{#if @model.errors.attributes.issuer}}
+ {{#if @model.errors.attributes_issuer}}
- {{#each @model.errors.attributes.issuer as |error|}}
+ {{#each @model.errors.attributes_issuer as |error|}}
{{error.message}}
{{/each}}
@@ -87,13 +86,13 @@
@value={{@model.attributes.client_id}}
@label={{t 'form.client_id.label'}}
@helperText={{t 'form.client_id.help'}}
- @error={{@model.errors.attributes.client_id}}
+ @error={{@model.errors.attributes_client_id}}
readonly={{false}}
as |field|
>
- {{#if @model.errors.attributes.client_id}}
+ {{#if @model.errors.attributes_client_id}}
- {{#each @model.errors.attributes.client_id as |error|}}
+ {{#each @model.errors.attributes_client_id as |error|}}
{{error.message}}
{{/each}}
@@ -106,34 +105,488 @@
@value={{@model.attributes.client_secret}}
@label={{t 'form.client_secret.label'}}
@helperText={{t 'form.client_secret.help'}}
- @error={{@model.errors.attributes.client_secret}}
+ @error={{@model.errors.attributes_client_secret}}
readonly={{false}}
as |field|
>
- {{#if @model.errors.attributes.client_secret}}
+ {{#if @model.errors.attributes_client_secret}}
- {{#each @model.errors.attributes.client_secret as |error|}}
+ {{#each @model.errors.attributes_client_secret as |error|}}
{{error.message}}
{{/each}}
{{/if}}
+ {{! Signing Algorithms }}
+
+ <:title>{{t 'form.signing_algorithms.label'}}
+ <:description>{{t 'form.signing_algorithms.help'}}
+ <:body>
+ {{#if @model.errors.attributes_signing_algorithms}}
+
+ {{#each @model.errors.attributes_signing_algorithms as |error|}}
+ {{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+
+ {{t 'titles.value'}}
+ {{t 'titles.actions'}}
+
+
+
+ {{#each @model.attributes.signing_algorithms as |algorithm i|}}
+
+
+
+ {{t 'form.algorithm.label'}}
+
+ {{#each this.signingAlgorithms as |algorithm|}}
+ {{algorithm}}
+ {{/each}}
+
+
+
+
+
+ {{t 'actions.remove'}}
+
+
+
+ {{/each}}
+
+
+
+
+
+ {{#each this.signingAlgorithms as |algorithm|}}
+ {{algorithm}}
+ {{/each}}
+
+
+
+
+
+ {{t 'actions.add'}}
+
+
+
+
+
+
+
+
+ {{! Allowed Audiences }}
+
+ <:title>{{t 'form.allowed_audiences.label'}}
+ <:description>{{t 'form.allowed_audiences.help'}}
+ <:body>
+ {{#if @model.errors.attributes_allowed_audiences}}
+
+ {{#each @model.errors.attributes_allowed_audiences as |error|}}
+ {{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+
+ {{t 'titles.value'}}
+ {{t 'titles.actions'}}
+
+
+
+ {{#each @model.attributes.allowed_audiences as |audience i|}}
+
+
+
+ {{t 'form.claim.label'}}
+
+
+
+
+
+ {{t 'actions.remove'}}
+
+
+
+ {{/each}}
+
+
+
+
+
+
+
+ {{t 'actions.add'}}
+
+
+
+
+
+
+
+
+ {{! Claims Scopes }}
+
+ <:title>{{t 'form.claims_scopes.label'}}
+ <:description>{{t 'form.claims_scopes.help'}}
+ <:body>
+ {{#if @model.errors.attributes_claims_scopes}}
+
+ {{#each @model.errors.attributes_claims_scopes as |error|}}
+ {{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+
+ {{t 'titles.value'}}
+
+
+
+
+ {{#each @model.attributes.claims_scopes as |claimsScope i|}}
+
+
+
+ {{t 'form.claims_scope.label'}}
+
+
+
+
+
+ {{t 'actions.remove'}}
+
+
+
+ {{/each}}
+
+
+
+
+
+
+
+ {{t 'actions.add'}}
+
+
+
+
+
+
+
+
+ {{! Account Claim Maps }}
+
+ <:title>{{t 'form.account_claim_maps.label'}}
+ <:description>{{t 'form.account_claim_maps.help'}}
+ <:body>
+ {{#if @model.errors.attributes_account_claim_maps}}
+
+ {{#each @model.errors.attributes_account_claim_maps as |error|}}
+ {{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+
+ {{t 'form.from_claim.label'}}
+ {{t 'form.to_claim.label'}}
+ {{t 'titles.actions'}}
+
+
+
+ {{#each @model.attributes.account_claim_maps as |claimMap i|}}
+
+
+
+ {{t 'form.from_claim.label'}}
+
+
+
+
+
+ {{t 'form.to_claim.label'}}
+
+ {{#each this.toClaims as |toClaim|}}
+ {{toClaim}}
+ {{/each}}
+
+
+
+
+
+ {{t 'actions.remove'}}
+
+
+
+ {{/each}}
+
+
+
+
+
+
+
+
+ {{#each this.toClaims as |toClaim|}}
+ {{toClaim}}
+ {{/each}}
+
+
+
+
+
+ {{t 'actions.add'}}
+
+
+
+
+
+
+
+
+ {{! Certificates }}
+
+ <:title>{{t 'form.idp_ca_certs.label'}}
+ <:description>{{t 'form.idp_ca_certs.help'}}
+ <:body>
+ {{#if @model.errors.attributes_idp_ca_certs}}
+
+ {{#each @model.errors.attributes_idp_ca_certs as |error|}}
+ {{error.message}}
+ {{/each}}
+
+ {{/if}}
+
+
+
+ {{t 'titles.value'}}
+ {{t 'titles.actions'}}
+
+
+
+ {{#each @model.attributes.idp_ca_certs as |cert i|}}
+
+
+
+ {{t 'form.certificate.label'}}
+
+
+
+
+
+ {{t 'actions.remove'}}
+
+
+
+ {{/each}}
+
+
+
+
+
+
+
+ {{t 'actions.add'}}
+
+
+
+
+
+
+
+
- {{#if @model.errors.attributes.max_age}}
+ {{#if @model.errors.attributes_max_age}}
- {{#each @model.errors.attributes.max_age as |error|}}
+ {{#each @model.errors.attributes_max_age as |error|}}
{{error.message}}
{{/each}}
@@ -146,13 +599,13 @@
@value={{@model.attributes.api_url_prefix}}
@label={{t 'form.api_url_prefix.label'}}
@helperText={{t 'form.api_url_prefix.help'}}
- @error={{@model.errors.attributes.api_url_prefix}}
+ @error={{@model.errors.attributes_api_url_prefix}}
readonly={{false}}
as |field|
>
- {{#if @model.errors.attributes.api_url_prefix}}
+ {{#if @model.errors.attributes_api_url_prefix}}
- {{#each @model.errors.attributes.api_url_prefix as |error|}}
+ {{#each @model.errors.attributes_api_url_prefix as |error|}}
{{error.message}}
{{/each}}
diff --git a/ui/admin/app/components/form/auth-method/oidc/index.js b/ui/admin/app/components/form/auth-method/oidc/index.js
new file mode 100644
index 000000000..166e33561
--- /dev/null
+++ b/ui/admin/app/components/form/auth-method/oidc/index.js
@@ -0,0 +1,20 @@
+import Component from '@glimmer/component';
+import { options } from 'api/models/auth-method';
+
+export default class FormAuthMethodOidcComponent extends Component {
+ // =attributes
+ /**
+ * @type {object}
+ */
+ signingAlgorithms = options.oidc.signing_algorithms;
+
+ /**
+ * @type {object}
+ */
+ toClaims = options.oidc.account_claim_maps.to;
+
+ /**
+ * @type {string}
+ */
+ newSigningAlgorithm = options.oidc.signing_algorithms[0];
+}
diff --git a/ui/admin/app/routes/scopes/scope/auth-methods.js b/ui/admin/app/routes/scopes/scope/auth-methods.js
index 291a9573d..31c0778a5 100644
--- a/ui/admin/app/routes/scopes/scope/auth-methods.js
+++ b/ui/admin/app/routes/scopes/scope/auth-methods.js
@@ -134,4 +134,45 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
}
await authMethod.reload();
}
+
+ /**
+ * Removes an item from array `property` at `index` on the
+ * passed `authMethod`. This is used to manage entries in fragment array
+ * fields such as `signing_algorithms`.
+ * @param {AuthMethodModel} authMethod
+ * @param {string} property
+ * @param {number} index
+ */
+ @action
+ async removeItemByIndex(authMethod, property, index) {
+ const array = authMethod.get(property);
+ array.removeAt(index);
+ }
+
+ /**
+ * Adds a string item to array `property` on the passed `authMethod`.
+ * This is used to manage entries in fragment OIDC string array fields such
+ * as `signing_algorithms`.
+ * @param {AuthMethodModel} authMethod
+ * @param {string} property
+ * @param {string} value
+ */
+ @action
+ async addStringItem(authMethod, property, value) {
+ const array = authMethod.get(property);
+ array.addObject({ value });
+ }
+
+ /**
+ * Adds an account claim map fragment to the passed OIDC `authMethod`.
+ * @param {AuthMethodModel} authMethod
+ * @param {string} property
+ * @param {string} value
+ */
+ @action
+ async addAccountClaimMapItem(authMethod, from, to) {
+ const array = authMethod.attributes.account_claim_maps;
+ const value = { from, to };
+ array.addObject(value);
+ }
}
diff --git a/ui/admin/app/styles/app.scss b/ui/admin/app/styles/app.scss
index 420258319..9defaac7b 100644
--- a/ui/admin/app/styles/app.scss
+++ b/ui/admin/app/styles/app.scss
@@ -80,11 +80,13 @@
}
}
- fieldset {
- margin-bottom: sizing.rems(m);
-
- legend {
- @extend .rose-form-label;
+ .rose-form-fieldset {
+ .rose-table {
+ .rose-form-label {
+ position: absolute;
+ top: -9999px;
+ left: -9999px;
+ }
}
}
}
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-navigation.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-navigation.hbs
index 568445801..2694041c8 100644
--- a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-navigation.hbs
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/-navigation.hbs
@@ -2,7 +2,15 @@
{{t 'titles.details'}}
-
- {{t 'resources.account.title_plural'}}
-
+ {{#if @model.isOIDC}}
+ {{#if (feature-flag 'oidc-account-crud')}}
+
+ {{t 'resources.account.title_plural'}}
+
+ {{/if}}
+ {{else}}
+
+ {{t 'resources.account.title_plural'}}
+
+ {{/if}}
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs
index b82869296..e3302df0b 100644
--- a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/index.hbs
@@ -2,4 +2,7 @@
@model={{@model}}
@submit={{route-action 'save' @model}}
@cancel={{route-action 'cancel' @model}}
+ @removeItemByIndex={{route-action 'removeItemByIndex' @model}}
+ @addStringItem={{route-action 'addStringItem' @model}}
+ @addAccountClaimMapItem={{route-action 'addAccountClaimMapItem' @model}}
/>
\ No newline at end of file
diff --git a/ui/admin/config/environment.js b/ui/admin/config/environment.js
index 21d1e3da6..1e9db7322 100644
--- a/ui/admin/config/environment.js
+++ b/ui/admin/config/environment.js
@@ -88,7 +88,8 @@ module.exports = function (environment) {
featureFlags: {
'primary-auth-method': true,
oidc: true,
- 'oidc-crud': false,
+ 'oidc-crud': true,
+ 'oidc-account-crud': false,
search: false,
filter: false,
capabilities: false,
@@ -131,6 +132,7 @@ module.exports = function (environment) {
ENV.featureFlags['primary-auth-method'] = true;
ENV.featureFlags['oidc'] = true;
ENV.featureFlags['oidc-crud'] = true;
+ //ENV.featureFlags['oidc-account-crud'] = true;
}
if (environment === 'test') {