[PM-5149] UI for unique SP entity id on organization sso configs (#7117)

* add ui for making sp entity id unique

* pretty

* updates
This commit is contained in:
Kyle Spearrin 2024-01-18 16:54:31 -05:00 committed by GitHub
parent c481d92948
commit 06c7c3fd18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 40 additions and 1 deletions

View File

@ -5176,6 +5176,12 @@
"spValidateCertificates": {
"message": "Validate certificates"
},
"spUniqueEntityId": {
"message": "Set a unique SP entity ID"
},
"spUniqueEntityIdDesc": {
"message": "Generate an identifier that is unique to your organization"
},
"idpEntityId": {
"message": "Entity ID"
},

View File

@ -307,7 +307,18 @@
<div class="config-section">
<h2 class="secondary-header">{{ "samlSpConfig" | i18n }}</h2>
<bit-form-field>
<bit-form-control>
<bit-label>{{ "spUniqueEntityId" | i18n }}</bit-label>
<input
bitCheckbox
type="checkbox"
formControlName="spUniqueEntityId"
id="spUniqueEntityId"
/>
<bit-hint>{{ "spUniqueEntityIdDesc" | i18n }}</bit-hint>
</bit-form-control>
<bit-form-field *ngIf="ssoConfigForm.value.saml.spUniqueEntityId">
<bit-label>{{ "spEntityId" | i18n }}</bit-label>
<input bitInput disabled [value]="spEntityId" />
<button
@ -319,6 +330,18 @@
></button>
</bit-form-field>
<bit-form-field *ngIf="!ssoConfigForm.value.saml.spUniqueEntityId">
<bit-label>{{ "spEntityId" | i18n }}</bit-label>
<input bitInput disabled [value]="spEntityIdStatic" />
<button
bitIconButton="bwi-clone"
bitSuffix
type="button"
[appCopyClick]="spEntityIdStatic"
[appA11yTitle]="'copyValue' | i18n"
></button>
</bit-form-field>
<bit-form-field>
<bit-label>{{ "spMetadataUrl" | i18n }}</bit-label>
<input bitInput disabled [value]="spMetadataUrl" />

View File

@ -104,6 +104,7 @@ export class SsoComponent implements OnInit, OnDestroy {
callbackPath: string;
signedOutCallbackPath: string;
spEntityId: string;
spEntityIdStatic: string;
spMetadataUrl: string;
spAcsUrl: string;
@ -132,6 +133,7 @@ export class SsoComponent implements OnInit, OnDestroy {
protected samlForm = this.formBuilder.group<ControlsOf<SsoConfigView["saml"]>>(
{
spUniqueEntityId: new FormControl(true, { updateOn: "change" }),
spNameIdFormat: new FormControl(Saml2NameIdFormat.NotConfigured),
spOutboundSigningAlgorithm: new FormControl(defaultSigningAlgorithm),
spSigningBehavior: new FormControl(Saml2SigningBehavior.IfIdpWantAuthnRequestsSigned),
@ -250,6 +252,7 @@ export class SsoComponent implements OnInit, OnDestroy {
this.callbackPath = ssoSettings.urls.callbackPath;
this.signedOutCallbackPath = ssoSettings.urls.signedOutCallbackPath;
this.spEntityId = ssoSettings.urls.spEntityId;
this.spEntityIdStatic = ssoSettings.urls.spEntityIdStatic;
this.spMetadataUrl = ssoSettings.urls.spMetadataUrl;
this.spAcsUrl = ssoSettings.urls.spAcsUrl;

View File

@ -30,6 +30,7 @@ export class SsoConfigApi extends BaseResponse {
api.acrValues = view.openId.acrValues;
api.expectedReturnAcrValue = view.openId.expectedReturnAcrValue;
} else if (api.configType === SsoType.Saml2) {
api.spUniqueEntityId = view.saml.spUniqueEntityId;
api.spNameIdFormat = view.saml.spNameIdFormat;
api.spOutboundSigningAlgorithm = view.saml.spOutboundSigningAlgorithm;
api.spSigningBehavior = view.saml.spSigningBehavior;
@ -72,6 +73,7 @@ export class SsoConfigApi extends BaseResponse {
expectedReturnAcrValue: string;
// SAML
spUniqueEntityId: boolean;
spNameIdFormat: Saml2NameIdFormat;
spOutboundSigningAlgorithm: string;
spSigningBehavior: Saml2SigningBehavior;
@ -113,6 +115,7 @@ export class SsoConfigApi extends BaseResponse {
this.acrValues = this.getResponseProperty("AcrValues");
this.expectedReturnAcrValue = this.getResponseProperty("ExpectedReturnAcrValue");
this.spUniqueEntityId = this.getResponseProperty("SpUniqueEntityId");
this.spNameIdFormat = this.getResponseProperty("SpNameIdFormat");
this.spOutboundSigningAlgorithm = this.getResponseProperty("SpOutboundSigningAlgorithm");
this.spSigningBehavior = this.getResponseProperty("SpSigningBehavior");

View File

@ -23,6 +23,7 @@ class SsoUrls extends BaseResponse {
callbackPath: string;
signedOutCallbackPath: string;
spEntityId: string;
spEntityIdStatic: string;
spMetadataUrl: string;
spAcsUrl: string;
@ -31,6 +32,7 @@ class SsoUrls extends BaseResponse {
this.callbackPath = this.getResponseProperty("CallbackPath");
this.signedOutCallbackPath = this.getResponseProperty("SignedOutCallbackPath");
this.spEntityId = this.getResponseProperty("SpEntityId");
this.spEntityIdStatic = this.getResponseProperty("SpEntityIdStatic");
this.spMetadataUrl = this.getResponseProperty("SpMetadataUrl");
this.spAcsUrl = this.getResponseProperty("SpAcsUrl");
}

View File

@ -34,6 +34,7 @@ export class SsoConfigView extends View {
};
saml: {
spUniqueEntityId: boolean;
spNameIdFormat: Saml2NameIdFormat;
spOutboundSigningAlgorithm: string;
spSigningBehavior: Saml2SigningBehavior;
@ -88,6 +89,7 @@ export class SsoConfigView extends View {
};
} else if (this.configType === SsoType.Saml2) {
this.saml = {
spUniqueEntityId: orgSsoResponse.data.spUniqueEntityId,
spNameIdFormat: orgSsoResponse.data.spNameIdFormat,
spOutboundSigningAlgorithm: orgSsoResponse.data.spOutboundSigningAlgorithm,
spSigningBehavior: orgSsoResponse.data.spSigningBehavior,